Portál AbcLinuxu, 11. listopadu 2025 04:47
https://wiki.archlinux.org/index.php/AutostartingAle zde jsem odpoved nenasel. Potrebuji spustit sluzbu shellinaboxd. To pres systemctl nelze. Pokud dam prikaz
shellinaboxd -p 8022 &Do /etc/profile, tak ma sluzba tendenci se spoustet pri kazdem prihlaseni do systemu (napr SSH). Otazka tedy zni, jak mohu sluzbu nechat spustit pouze po startu systemu?
Řešení dotazu:
nano /etc/systemd/system/shellinaboxd.service [Unit] Description=shellinaboxd [Service] User=shellinaboxd ExecStart=/usr/bin/shellinaboxd -p 8022 ExecStop=/..... PIDFile=/var/run/shellinaboxd/shellinaboxd.pid [Install] WantedBy=multi-user.targetResp. něco podle již linkovaného : systemd/Services
[user@server~]$ sudo systemctl enable rc-local.service
The unit files have no [Install] section. They are not meant to be enabled using systemctl.
[user@server~]$ systemctl status rc-local.service
rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc-local.service; static)
Active: failed (Result: exit-code) since Thu, 2012-11-01 11:23:04 CET; 8s ago
Process: 1931 ExecStart=/etc/rc.local start (code=exited, status=203/EXEC)
CGroup: name=systemd:/system/rc-local.service
[user@server ~]$ sudo systemctl start rc-local.service
Job for rc-local.service failed. See 'systemctl status rc-local.service' and 'journalctl -n' for details.
[user@server ~]$ sudo systemctl status rc-local.service
rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc-local.service; enabled)
Active: failed (Result: exit-code) since Thu, 2012-11-01 11:39:20 CET; 1min 13s ago
Process: 541 ExecStart=/etc/rc.local start (code=exited, status=203/EXEC)
CGroup: name=systemd:/system/rc-local.service
Nov 01 11:39:20 server systemd[1]: Starting /etc/rc.local Compatibility...
Nov 01 11:39:20 server systemd[1]: Failed to start /etc/rc.local Compatibility.
Nov 01 11:39:20 server systemd[1]: Unit rc-local.service entered failed state
$ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 135 Nov 1 11:31 /etc/rc.local
#!/bin/sh.
nano /etc/systemd/system/rc-local.service [Unit] Description=/etc/rc.local Compatibility ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target systemctl enable rc-local ln -s '/etc/systemd/system/rc-local.service' '/etc/systemd/system/multi-user.target.wants/rc-local.service'Zdar Max
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.