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
Description
Running systemctl disable sys-kernel-debug.mount does nothing. Expected behaviour is to remove all relevant symlinks as is expected from the disable operation.
Reproducible with the current master (commit da6c780).
Steps to reproduce
Compile and install systemd.
Check that the unit file is there.
# ls -la /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount
lrwxrwxrwx 1 root root 25 May 23 12:52 /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount -> ../sys-kernel-debug.mount
Disable the mount unit.
# systemctl disable sys-kernel-debug.mount
Nothing really happened. The symlink is still there.
# ls -la /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount
lrwxrwxrwx 1 root root 25 May 23 12:52 /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount -> ../sys-kernel-debug.mount
Maybe that's because the sys-kernel-debug.mount doesn't have the Install section. Let's try adding that to the unit file.
Edit /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount and add the following content to the end of the file:
[Install]
WantedBy=sysinit.target
Restart init. # init q
Disable the mount unit.
# systemctl disable sys-kernel-debug.mount
Nothing happened, again. The symlink is still there.
# ls -la /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount
lrwxrwxrwx 1 root root 25 May 23 12:52 /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount -> ../sys-kernel-debug.mount
After step 8), I expect that the symlink /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount should not exist, that is, it was removed by the disable operation.
The text was updated successfully, but these errors were encountered:
sys-kernel-debug.mount is statically enabled. As you noticed the symlinks are in /usr, not /etc.
So an [Install] section will not help, as those symlinks are kept in /etc.
You could try to mask the mount unit though.
poettering
changed the title
systemctl disable doesn't work on sys-kernel-debug.mount
systemctl disable on statically enabled units should log a useful message
May 23, 2018
Also, you might consider changing the docs a bit, as it is not perfectly clear (to me, at least) why it's not working. The docs say the following about the disable operation (man systemctl):
This removes all symlinks to the unit files backing the specified units from the unit configuration directory, and hence undoes any changes made by enable or link.
Clearly, not all symlinks are removed and I count /usr/lib/systemd/system as a configuration directory.
Description
Running
systemctl disable sys-kernel-debug.mount
does nothing. Expected behaviour is to remove all relevant symlinks as is expected from the disable operation.Reproducible with the current master (commit da6c780).
Steps to reproduce
Maybe that's because the
sys-kernel-debug.mount
doesn't have the Install section. Let's try adding that to the unit file./usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount
and add the following content to the end of the file:Restart init.
# init q
Disable the mount unit.
After step 8), I expect that the symlink
/usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount
should not exist, that is, it was removed by the disable operation.The text was updated successfully, but these errors were encountered: