Cannot mask roonbridge service

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Sedim
Posts: 2
Joined: Sat Apr 28, 2018 3:15 pm

Cannot mask roonbridge service

Post by Sedim » Sat May 26, 2018 12:50 am

I am having trouble masking the roonbridge service. Other services mask just fine. Is there a workaround?
dietpi v6.7 RPi 3B

Code: Select all

[email protected]:/etc/systemd/system# dietpi-services status
[  OK  ] Root access verified.

 DietPi-Services
─────────────────────────────────────────────────────
 Mode: status

[  OK  ] DietPi-Services | avahi-daemon	active (running) since Fri 2018-05-25 19:18:39 EDT; 3min 21s ago
[  OK  ] DietPi-Services | nmbd	active (running) since Fri 2018-05-25 19:18:40 EDT; 3min 20s ago
[  OK  ] DietPi-Services | smbd	active (running) since Fri 2018-05-25 19:18:40 EDT; 3min 20s ago
[  OK  ] DietPi-Services | mpd	active (running) since Fri 2018-05-25 19:18:40 EDT; 3min 20s ago
[  OK  ] DietPi-Services | shairport-sync	active (running) since Fri 2018-05-25 19:18:41 EDT; 3min 20s ago
[  OK  ] DietPi-Services | networkaudiod	active (running) since Fri 2018-05-25 19:18:41 EDT; 3min 20s ago
[  OK  ] DietPi-Services | roonbridge	active (running) since Fri 2018-05-25 19:18:41 EDT; 3min 20s ago
[  OK  ] DietPi-Services | cron	active (running) since Fri 2018-05-25 19:18:41 EDT; 3min 19s ago
[  OK  ] DietPi-Services | ssh	active (running) since Fri 2018-05-25 19:18:29 EDT; 3min 31s ago
[  OK  ] DietPi-Services | dietpi-boot	active (exited) since Fri 2018-05-25 19:18:38 EDT; 3min 22s ago
[  OK  ] DietPi-Services | dietpi-postboot	active (exited) since Fri 2018-05-25 19:18:38 EDT; 3min 22s ago
[email protected]:/etc/systemd/system# 
[email protected]:/etc/systemd/system# 
[email protected]:/etc/systemd/system# 
[email protected]:/etc/systemd/system# dietpi-services mask mpd
[  OK  ] Root access verified.

 DietPi-Services
─────────────────────────────────────────────────────
 Mode: mask

Created symlink /etc/systemd/system/mpd.service → /dev/null.
[  OK  ] DietPi-Services | mask mpd
[email protected]:/etc/systemd/system# dietpi-services mask roonbridge
[  OK  ] Root access verified.

 DietPi-Services
─────────────────────────────────────────────────────
 Mode: mask

[b]Failed to mask unit: File /etc/systemd/system/roonbridge.service already exists.
[FAILED] DietPi-Services | mask roonbridge[/b]
[email protected]:/etc/systemd/system# 

User avatar
MichaIng
Site Admin
Posts: 1728
Joined: Sat Nov 18, 2017 5:21 pm

Re: Cannot mask roonbridge service

Post by MichaIng » Sat May 26, 2018 12:32 pm

@Sedim
Thanks for this report. Indeed there is an issue with masking custom services.

Systemd and Debian packages place their service unit files into /lib/systemd/system. When masking, a symlink to /dev/null (empty) will be created within /etc/systemd/system. Files there with the same name are handled as overwrites to the files in /lib/systemd/system, thus the service is empty then/nothing loaded.

The problem now is, that /etc/systemd/system is as well the desired location for customized or new service files, not created by systemd or APT packages. roonbridge.service is created by dietpi-software besides some other or our offered software services, especially where no APT packages are available. Thus all of them cannot be masked. The symlink location is already blocked by the manual service files.

Since DietPi handles it's services by itself, thus disable it for systemd, there is currently no intended way to disable/mask them completely.

The best current way for you is to simply remove /etc/systemd/system/roonbridge.service.
You can recover it at any time from /DietPi/dietpi/conf/roonbridge.service.

I will implement a possibility to mask custom services for next DietPi version by renaming the service file back and forth.
€: Issue on github opened: https://github.com/Fourdee/DietPi/issues/1809

User avatar
MichaIng
Site Admin
Posts: 1728
Joined: Sat Nov 18, 2017 5:21 pm

Re: Cannot mask roonbridge service

Post by MichaIng » Sun Aug 11, 2019 8:53 pm

I btw removed this feature from planned implementations. It makes things much too complicated. If one does not want DietPi to start/stop a service on boot and maintenance tasks, it can be excluded easily now via new dietpi-services 2.0 UI.
We might move DietPi services (and custom software services) to /usr/local/lib/systemd/system by times. Needs testing if this location is scanned. At least /usr/lib/systemd/system is, even that it is not documented anywhere.
/etc/systemd/system would then be used for masks only and drop-in <name>.service.d/*.conf configs.

Post Reply