You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**To Build and Run the `ipp-usb` Rock Image Locally, follow these steps**
301
+
**To Build and Run the `ipp-usb` Rock Image Locally, follow these steps**
302
302
303
-
#### **1. Build the `ipp-usb` Rock Image**
304
-
The first step is to build the Rock image from the `rockcraft.yaml` configuration file. This image will include all required dependencies and configurations for `ipp-usb`.
303
+
#### **1. Build the `ipp-usb` Rock Image**
304
+
The first step is to build the Rock image from the `rockcraft.yaml` configuration file. This image will include all required dependencies and configurations for `ipp-usb`.
305
305
306
-
Navigate to the directory containing `rockcraft.yaml` and run:
306
+
Navigate to the directory containing `rockcraft.yaml` and run:
307
307
```sh
308
308
rockcraft pack -v
309
-
```
309
+
```
310
310
311
-
#### **2. Convert the Rock Image to a Docker Image**
312
-
Once the `.rock` file is built, convert it into a Docker image using:
311
+
#### **2. Convert the Rock Image to a Docker Image**
312
+
Once the `.rock` file is built, convert it into a Docker image using:
-**`--network host`** → Uses the host’s network to enable proper IPP-over-USB and Avahi service discovery.
350
-
-**`-v /dev/bus/usb:/dev/bus/usb:ro`** → Grants read-only access to USB devices for printer detection.
351
-
-**`-v ipp-usb-state:/var/ipp-usb`** → Mounts the persistent storage volume for printer state, lock files, and logs.
352
-
-**`-v ipp-usb-conf:/etc/ipp-usb`** → Ensures configuration and quirks files persist across reboots.
353
-
-**`--device-cgroup-rule='c 189:* rmw'`** → Grants read, write, and management permissions for USB printers inside the container.
349
+
-**`--network host`** → Uses the host’s network to enable proper IPP-over-USB and Avahi service discovery.
350
+
-**`-v /dev/bus/usb:/dev/bus/usb:ro`** → Grants read-only access to USB devices for printer detection.
351
+
-**`-v ipp-usb-state:/var/ipp-usb`** → Mounts the persistent storage volume for printer state, lock files, and logs.
352
+
-**`-v ipp-usb-conf:/etc/ipp-usb`** → Ensures configuration and quirks files persist across reboots.
353
+
-**`--device-cgroup-rule='c 189:* rmw'`** → Grants read, write, and management permissions for USB printers inside the container.
354
354
355
355
### Accessing the Container Shell
356
356
@@ -360,103 +360,103 @@ To enter the running `ipp-usb` container and access a shell inside it, use:
360
360
```
361
361
This allows you to inspect logs, debug issues, or manually run commands inside the container.
362
362
363
-
### Configuration
363
+
### Configuration
364
364
365
-
The `ipp-usb` container uses a configuration file located at:
365
+
The `ipp-usb` container uses a configuration file located at:
366
366
```sh
367
367
/etc/ipp-usb/ipp-usb.conf
368
368
```
369
-
By default, the container uses the built-in configuration, which can be modified from inside the container.
369
+
By default, the container uses the built-in configuration, which can be modified from inside the container.
370
370
371
-
**Modifying the Configuration File Inside the Container**
371
+
**Modifying the Configuration File Inside the Container**
372
372
373
-
#### **1. Enter the Running Container**
374
-
Use the following command to access the container’s shell:
373
+
#### **1. Enter the Running Container**
374
+
Use the following command to access the container’s shell:
375
375
```sh
376
376
sudo docker exec -it ipp-usb bash
377
377
```
378
378
379
-
#### **2. Open the Configuration File in Nano**
380
-
Once inside the container, open the configuration file using `nano`:
379
+
#### **2. Open the Configuration File in Nano**
380
+
Once inside the container, open the configuration file using `nano`:
381
381
```sh
382
382
nano /etc/ipp-usb/ipp-usb.conf
383
383
```
384
384
385
-
#### **3. Edit and Save the File**
386
-
- Make the necessary changes to the file.
387
-
- Press `CTRL + X`, then `Y`, and hit `Enter` to save the changes.
385
+
#### **3. Edit and Save the File**
386
+
- Make the necessary changes to the file.
387
+
- Press `CTRL + X`, then `Y`, and hit `Enter` to save the changes.
388
388
389
-
#### **4. Restart the Container to Apply Changes**
390
-
Exit the container and restart it to apply the updated configuration:
389
+
#### **4. Restart the Container to Apply Changes**
390
+
Exit the container and restart it to apply the updated configuration:
391
391
```sh
392
392
sudo docker restart ipp-usb
393
393
```
394
394
395
-
### **Viewing Logs in the `ipp-usb` Container**
395
+
### **Viewing Logs in the `ipp-usb` Container**
396
396
397
-
The `ipp-usb` container logs important events and errors to `/var/log/ipp-usb/`. Logs are categorized into:
397
+
The `ipp-usb` container logs important events and errors to `/var/log/ipp-usb/`. Logs are categorized into:
398
398
399
-
-**Main log file:**`/var/log/ipp-usb/main.log` → Captures overall service activity, including errors and general events.
400
-
-**Per-device logs:**`/var/log/ipp-usb/<DEVICE>.log` → Individual log files for each detected printer, helpful for troubleshooting device-specific issues.
399
+
-**Main log file:**`/var/log/ipp-usb/main.log` → Captures overall service activity, including errors and general events.
400
+
-**Per-device logs:**`/var/log/ipp-usb/<DEVICE>.log` → Individual log files for each detected printer, helpful for troubleshooting device-specific issues.
401
401
402
-
#### **1. Using Docker Logs**
402
+
#### **1. Using Docker Logs**
403
403
404
-
To view real-time logs from the running container, use:
404
+
To view real-time logs from the running container, use:
405
405
```sh
406
406
sudo docker logs -f ipp-usb
407
-
```
408
-
- The `-f` flag follows the logs in real-time.
409
-
- Replace `ipp-usb` with your actual container name if different.
407
+
```
408
+
- The `-f` flag follows the logs in real-time.
409
+
- Replace `ipp-usb` with your actual container name if different.
410
410
411
-
#### **2. Viewing Logs Inside the Container**
411
+
#### **2. Viewing Logs Inside the Container**
412
412
413
-
If you need to inspect logs manually, first enter the container shell:
413
+
If you need to inspect logs manually, first enter the container shell:
414
414
```sh
415
415
sudo docker exec -it ipp-usb bash
416
-
```
416
+
```
417
417
418
-
Once inside the container, you can use the following commands:
418
+
Once inside the container, you can use the following commands:
419
419
420
-
#### **2.1 Monitor Logs in Real-Time**
420
+
#### **2.1 Monitor Logs in Real-Time**
421
421
422
-
-**Main log file:**
422
+
-**Main log file:**
423
423
```sh
424
424
tail -f /var/log/ipp-usb/main.log
425
-
```
426
-
This continuously displays new log entries for the entire service.
425
+
```
426
+
This continuously displays new log entries for the entire service.
427
427
428
-
-**Per-device log file (Replace `<DEVICE>` with your printer's identifier):**
428
+
-**Per-device log file (Replace `<DEVICE>` with your printer's identifier):**
429
429
```sh
430
430
tail -f /var/log/ipp-usb/<DEVICE>.log
431
-
```
431
+
```
432
432
433
-
#### **2.2 Display Full Log Files**
433
+
#### **2.2 Display Full Log Files**
434
434
435
-
-**Show full contents of the main log file:**
435
+
-**Show full contents of the main log file:**
436
436
```sh
437
437
cat /var/log/ipp-usb/main.log
438
-
```
438
+
```
439
439
440
-
-**Show logs for a specific device:**
440
+
-**Show logs for a specific device:**
441
441
```sh
442
442
cat /var/log/ipp-usb/<DEVICE>.log
443
-
```
443
+
```
444
444
445
-
#### **2.3 List Available Device Logs**
445
+
#### **2.3 List Available Device Logs**
446
446
447
-
To see all available per-device log files, run:
447
+
To see all available per-device log files, run:
448
448
```sh
449
449
ls /var/log/ipp-usb/
450
-
```
450
+
```
451
451
452
-
#### **3. Persisting Logs Across Container Restarts**
452
+
#### **3. Persisting Logs Across Container Restarts**
453
453
454
-
If you want logs to persist across container restarts, you should mount the log directory using a Docker volume or a host directory.
454
+
If you want logs to persist across container restarts, you should mount the log directory using a Docker volume or a host directory.
455
455
456
-
**Required Docker Flags for Log Persistence:**
457
-
-`-v <volume-name>:/var/log/ipp-usb` → Mounts a Docker volume for log persistence.
458
-
-**or**
459
-
-`-v <host-directory>:/var/log/ipp-usb` → Mounts a host directory to retain logs outside the container.
456
+
**Required Docker Flags for Log Persistence:**
457
+
-`-v <volume-name>:/var/log/ipp-usb` → Mounts a Docker volume for log persistence.
458
+
-**or**
459
+
-`-v <host-directory>:/var/log/ipp-usb` → Mounts a host directory to retain logs outside the container.
460
460
461
461
These options ensure that logs remain available even after the container stops or is recreated, allowing for easier troubleshooting and auditing.
0 commit comments