|
Bugzilla – Full Text Bug Listing |
| Summary: | systemd "service start" immediately followed by "service stop" if no process running | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE 12.3 | Reporter: | Ralf Friedl <Ralf.Friedl> |
| Component: | Basesystem | Assignee: | E-mail List <bnc-team-screening> |
| Status: | RESOLVED INVALID | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | fcrozat, Ralf.Friedl |
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | openSUSE 12.2 | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
systemd has to use some heuristic to detect if an initscript is a "remainafterexit" service (ie not having any process left is OK" or not. If an initscript is taking a long time to start, the heuristic will disable the "RemainAfterExit" flag. If you want to enforce one behaviour, add to your initscript LSB header the following line: # X-Systemd-RemainAfterExit: true (or false) (of course, I would suggest to use a systemd .service file if you can, but that's another story). Thank you, works as expected. closing bug as invalid then. |
User-Agent: Mozilla/5.0 (Windows; U; Win98; de-AT; rv:1.8.1.24) Gecko/20100228 SeaMonkey/1.1.19 Actually, system is openSUSE 12.3, but that is not (yet) available from the Operating System selection box. I have created an init script that executes some commands, but doesn't leave a process running. When it is started, whether by "systemctl start local.service" or "/etc/init.d/local start" (which calls systemctl), systemd executes "/etc/init.d/local start" with SYSTEMD_NO_WRAP set. The script is executed and return status 0 for success. So far everything is well. The problem is that now systemd immediately executed "/etc/init.d/local stop". But the stop action undoes the effects of the start action and is only meant to be called at shutdown. This used to work with the original openSUSE 12.2, but no longer after some updates to systemd. Reproducible: Always Steps to Reproduce: 1. Create startup script /etc/init.d/local that doesn't leave process running. 2. Call systemctl to have systemd execute the script. Actual Results: systemd calls "/etc/init.d/local start". The script exits with status 0. systemd calls "/etc/init.d/local stop". Expected Results: systemd calls "/etc/init.d/local start". The script exits with status 0. systemd doesn't call "/etc/init.d/local stop" until system shutdown. I verified that it is really not leaving a running progress by adding this line: ( sleep 999999 & ) Now everything works as expected, except when I kill the sleep process (or it dies for other reasons), systemd will execute the stop action of the script.