systemd can't start daemon if its initscript is symliked onto a partition other than root.
Issue
-
systemd can't start daemon if its initscript is a symliked file to a partition other than root.
[root@server ~]# df / /mnt/test Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda2 6981632 990768 5990864 15% / /dev/sdb1 1044140 32932 1011208 4% /mnt/test [root@server ~]# ls -l /etc/rc.d/init.d/test_daemon lrwxrwxrwx. 1 root root 24 Oct 20 15:25 /etc/rc.d/init.d/test_daemon -> /mnt/test/test_daemon.sh [root@server ~]# reboot ... [root@server ~]# systemctl status test_daemon test_daemon.service - SYSV: Test Script Loaded: loaded (/etc/rc.d/init.d/test_daemon) Active: inactive (dead)
-
If the real file of the initscript is placed in /etc/rc.d/init.d, the daemon is activated.
[root@server ~]# ls -l /etc/rc.d/init.d/test_daemon* lrwxrwxrwx. 1 root root 14 Oct 20 15:56 /etc/rc.d/init.d/test_daemon -> test_daemon.sh -rwxr-xr-x. 1 root root 728 Oct 20 14:24 /etc/rc.d/init.d/test_daemon.sh [root@server ~]# reboot ... [root@server ~]# systemctl status test_daemon test_daemon.service - SYSV: Test Script Loaded: loaded (/etc/rc.d/init.d/test_daemon) Active: active (running) since Tue 2015-10-20 15:57:12 JST; 6s ago Process: 1076 ExecStart=/etc/rc.d/init.d/test_daemon start (code=exited, status=0/SUCCESS) CGroup: /system.slice/test_daemon.service └─1114 /usr/local/sbin/test_daemon
Environment
- Red Hat Enterprise Linux 7
- systemd
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.