service - systemd: recover from systemctl hang -
i have custom systemd ".service" file, one:
[unit] description=mystuff after=syslog.target after=network.target after=local-fs.target after=remote-fs.target [service] type=simple user=root group=root execstart=/usr/local/mystuff/start execreload=/bin/kill $mainpid && /usr/bin/cat /var/run/mystuff.pid | /usr/bin/xargs --no-run-if-empty /bin/kill execstop=/bin/kill $mainpid && /usr/bin/cat /var/run/mystuff.pid | /usr/bin/xargs --no-run-if-empty /bin/kill execstartpost=/usr/local/mystuff/after_start.sh pidfile=/var/run/mystuff.pid #remainafterexit=yes timeoutsec=300 restart=always restartsec=10 [install] wantedby=multi-user.target it worked fine until minutes ago. systemctl stop mystuff hung way:
[root@live-1 ffmpeg]# systemctl status wowzastreamingengine ● mystuff.service - mystuff loaded: loaded (/usr/lib/systemd/system/mystuff.service; enabled; vendor preset: disabled) active: deactivating (final-sigkill) (result: timeout) since vie 2017-07-28 11:12:23 -03; 23min ago main pid: 25149 cgroup: /system.slice/mystuff.service jul 28 11:12:23 live-1 kill[10382]: kill: cannot find process "/usr/bin/cat" jul 28 11:12:23 live-1 kill[10382]: kill: cannot find process "/var/run/mystuff.pid" jul 28 11:12:23 live-1 kill[10382]: kill: cannot find process "|" jul 28 11:12:23 live-1 kill[10382]: kill: cannot find process "/usr/bin/xargs" jul 28 11:12:23 live-1 kill[10382]: kill: cannot find process "--no-run-if-empty" jul 28 11:12:23 live-1 kill[10382]: kill: cannot find process "/bin/kill" jul 28 11:12:23 live-1 systemd[1]: mystuff.service: control process exited, code=exited status=1 jul 28 11:17:24 live-1 systemd[1]: mystuff.service stop-sigterm timed out. killing. jul 28 11:22:24 live-1 systemd[1]: mystuff.service still around after sigkill. ignoring. jul 28 11:31:22 live-1 systemd[1]: mystuff.service stop-final-sigterm timed out. killing. i know there errors reported there. not problem; i'm not asking errors. problem is: systemd/systemctl hangs in state, , i'm unable start/stop/restart actions because of them stays waiting forever.
what need know way around state. time rebooted server, because development environment. can't deal way on production.
so: when systemd/systemctl hangs way, can in order recover service state without rebooting server?
thanks in advance.
Comments
Post a Comment