summaryrefslogtreecommitdiff
path: root/src/core/service.c
AgeCommit message (Collapse)Author
2013-01-24service: make sure the watchdog timer is not restarted while stoppingMichael Olbrich
A watchdog notification may be handled after the watchdog timer was stopped while stopping the service. As a result the timer is restarted and the service may be restarted as well. The watchdog timestamp is initially set during startup in service_enter_start_post() and cleared when the timer is stopped. Therefore it can be used as an indication if the timer should be reset.
2013-01-24service: really stop watchdog timer when stoppingMichael Olbrich
For services without ExecStop= the state SERVICE_STOP is never entered. as a result the watchdog timer is not stopped and the service is restarted (if it is configuered to restart). Stopping the watchdog timer for SERVICE_STOP_SIGTERM as well fixes this.
2013-01-19unit: optionally allow making cgroup attribute changes persistentLennart Poettering
2013-01-18core: log USER_UNIT instead of UNIT if in user sessionMirco Tischler
2013-01-17service: properly signal permanent failure of a service to its socketLennart Poettering
This makes sure that a service is not indefinitely restarted in a tight loop if it fails before it is able to process its socket. This corrects the breakage introduced with 8d1b002a2e389e79a2414491523de549783abf73. Shame on me.
2013-01-16service: ignore dependencies on $syslog and $local_fs in LSB scriptsLennart Poettering
We no longer allow early-boot init scripts, however in late boot the syslog socket and local mounts are established anyway, so let's simplify our dep graph a bit. If $syslog doesn't resolve to syslog.target anymore there's no reason to keep syslog.target around anymore. Let's remove it. Note that many 3rd party service unit files order themselves after syslog.target. These will be dangling dependencies now, which should be unproblematic, however.
2013-01-16service: sysv - remove distribution specific targetsKay Sievers
Systemd should not introduce any new facilities. Distributions which still need to support their non-standard/legacy facilities should add them as patches to their packaging. The following facilities are no longer recognized: $x-display-manager $mail-transfer-agent $mail-transport-agent $mail-transfer-agent $smtp $null This target is no longer available: mail-transfer-agent.target
2013-01-14service: for Type=forking services, ignore exit status of main process ↵Lennart Poettering
depending on ExecStart's ignore setting https://bugzilla.redhat.com/show_bug.cgi?id=860464
2013-01-12service: remove distribution specific comments, the code runs unconditional nowKay Sievers
2013-01-12service: remove distribution specific comments, the code run unconditional nowKay Sievers
2013-01-06systemd: use unit logging macrosZbigniew Jędrzejewski-Szmek
2013-01-04service: fixup after ifdef droppingZbigniew Jędrzejewski-Szmek
Commit 88516c0 removed one line too much.
2013-01-04service: drop inserv.conf parsingLennart Poettering
This Suse specific configuration file should really be done in a generator that is shipped downstream by suse.
2013-01-04service: drop the per-distro ifdefs in service.cLennart Poettering
They don't really hurt on other distros, and this allows us to ship the same code on all distros
2012-11-24build-sys: drop TARGET_UBUNTULennart Poettering
TARGET_UBUNTU is effectively the same as TARGET_DEBIAN. Given the Ubuntu is unlikely to use systemd anytime soon there's no point in keeping this separate.
2012-11-23timer: implement calendar time eventsLennart Poettering
2012-11-22manager: introduce watch_init() initializer for watchesLennart Poettering
2012-11-16service: drop support for SysV scripts for the early bootLennart Poettering
This remove distro-specific support for early-boot SysV init scripts. (And leaves support for normal SysV scripts untouched). If distributions wish to continue to allow early-boot SysV scripts in their distribution-specific way they should either maintain this patch downstream manually, or write a generator for them, or simply ship all those scripts with a .service wrapper.
2012-11-16shutdown: readd explicit sync() when shutting downLennart Poettering
As it turns out reboot() doesn't actually imply a file system sync, but only a disk sync. Accordingly, readd explicit sync() invocations immediately before we invoke reboot(). This is much less dramatic than it might sounds as we umount all disks/read-only remount them anyway before going down.
2012-10-31service: drop special HTTP server target, as it is a bad idea anf Fedora ↵Lennart Poettering
specific This was premarily intended to support the LSB facility $httpd which is only known by Fedora, and a bad idea since it lacks any real-life usecase. Similar, drop support for some other old Fedora-specific facilities. Also, document the rules for introduction of new facilities, to clarify the situation for the future.
2012-10-18systemd: use structured logging for unit changesZbigniew Jędrzejewski-Szmek
Information which unit a log entry pertains to enables systemctl status to display more log messages.
2012-10-18service: when invoking service processes in --user mode set MANAGERPID to ↵Lennart Poettering
PID of systemd
2012-10-16service: Heuristically determine whether SysV scripts support reloadMichael Stapelberg
This commit checks for a usage line which contains [{|]reload[|}"] (to not errnously match force-reload). Heuristics like this suck, but it solves a real problem and there appears to be no better way...
2012-10-16core: allow Type=oneshot services to have ExecReloadMantas Mikulėnas
Use cases: * iptables.service – atomically reload rules without having to flush them beforehand (which may leave the system insecure if reload fails) * rpc-nfsd.service – reexport filesystems after /etc/exports update without completely stopping and restarting nfsd (In both cases, the actual service is provided by a kernel module and does not have any associated user-space processes, thus Type=oneshot.)
2012-09-21journal: completely rework the mmap cache as I too dumb to actually ↵Lennart Poettering
understand it Instead of doing hand optimized fd bisect arrays just use plain old hashmaps. Now I can understand my own code again. Yay! As a side effect this should fix some bad memory accesses caused by accesses after mmap(), introduced in 189.
2012-09-18core: move ManagerRunningAs to sharedZbigniew Jędrzejewski-Szmek
Note: I did s/MANAGER/SYSTEMD/ everywhere, even though it makes the patch quite verbose. Nevertheless, keeping MANAGER prefix in some places, and SYSTEMD prefix in others would just lead to confusion down the road. Better to rip off the band-aid now.
2012-09-18unit-printf: before resolving exec context specifiers check whether the ↵Lennart Poettering
object actually has an exec context
2012-09-18unit: split unit_printf() and friends into its own .c fileLennart Poettering
2012-09-17conf-parser: don't unescape parsed configuration strings by defaultLennart Poettering
In many cases this might have a negative effect since we drop escaping from strings where we better shouldn't have dropped it. If unescaping makes sense for some settings we can readd it later again, on a per-case basis. https://bugs.freedesktop.org/show_bug.cgi?id=54522
2012-09-17service: don't hit an assert if a service unit changes type and we get a ↵Lennart Poettering
spurious event from before
2012-08-22service: introduce a proper service result if the start limit is hitLennart Poettering
2012-08-14service: add options RestartPreventExitStatus and SuccessExitStatusLukas Nykryn
In some cases, like wrong configuration, restarting after error does not help, so administrator can specify statuses by RestartPreventExitStatus which will not cause restart of a service. Sometimes you have non-standart exit status, so this can be specified by SuccessfulExitStatus.
2012-08-08systemd: introduced new timeout typesMichal Sekletar
Makes possible to specify separate timeout for start and stop of the service. [ Improved the manpage. Coding style fix. -- michich ]
2012-07-23sd-daemon: remove unnecessary memset callsJim Meyering
There is no point in clearing the bits of a "struct stat" when the very next statement just calls stat or fstat to fill in that same memory. [zj: two more places]
2012-07-20units: apply default resource limits to socket/mount/swap processes tooLennart Poettering
2012-07-20core: drop KillMode parameter from KillUnit() bus callLennart Poettering
It made no sense, and since we are documenting the bus calls now and want to include them in our stability promise we really should get it cleaned up sooner, not later.
2012-07-20unit: split off KillContext from ExecContext containing only kill definitionsLennart Poettering
2012-07-18service: don't print a warning if we are in autorestart state, and can't ↵Lennart Poettering
start a unit just yet
2012-07-18service: make start jobs wait, not fail, when an automatic restart is queuedLennart Poettering
When an automatic restart is already queued, then make subsequent start jobs wait until the restart can be handled (i.e. after the holdhoff time), instead of simply fail.
2012-07-16unit: set default working directory to the user's home directory when ↵Lennart Poettering
running in user mode
2012-07-13unit: rename BindTo= to BindsTo=Lennart Poettering
all other dependencies are in 3rd person. Change BindTo= accordingly to BindsTo=. Of course, the dependency is widely used, hence we parse the old name too for compatibility.
2012-07-13util: rename join() to strjoin()Lennart Poettering
This is to match strappend() and the other string related functions.
2012-07-10unit: get rid of UnitVTable.suffix, which is now unusedLennart Poettering
2012-07-04service: flush the start counter in "systemctl reset-failed"Lennart Poettering
2012-06-26service: pass via FAILED/DEAD before going to AUTO_RESTARTMichal Schmidt
With misconfigured mysql, which uses Restart=always, the following two messages would loop indefinitely and the "systemctl start" would never finish: Job pending for unit, delaying automatic restart. mysqld.service holdoff time over, scheduling restart. In service_enter_dead() always set the state to SERVICE_FAILED/DEAD first before setting SERVICE_AUTO_RESTART. This is to allow running jobs to complete. OnFailure will be also triggered at this point, so there's no need to do it again from service_stop() (where it was added in commit f0c7b229). Note that OnFailure units should better trigger only after giving up auto-restarting, but that's for another patch to solve. https://bugzilla.redhat.com/show_bug.cgi?id=832039
2012-06-26service: fix incorrect argumentMichal Schmidt
The last argument to service_enter_dead() is bool allow_restart, not a service result.
2012-06-22core: remove sysv_console optionLennart Poettering
This option never made much sense. It was originally intended to make sure that the usual startup output of sysv scripts goes to the terminal. However, since SysV scripts started from a terminal would not output to that terminal, but rather /dev/console this effect was more often than not actually taking place. Nowadays systemd has much nicer boot time status output than SysV which makes the sysv output redundant. Finally, all output of services goes to the journal anyway, and is not lost. Hence, let's drop this option, and simplify things a bit.
2012-06-22journal: set the _SYSTEMD_UNIT field for messages from terminated processesEelco Dolstra
As described in https://bugs.freedesktop.org/show_bug.cgi?id=50184 the journal currently doesn't set fields such as _SYSTEMD_UNIT properly for messages coming from processes that have already terminated. This means among other things that "systemctl status" may not show some of the output of services that wrote messages just before they exited. This patch fixes this by having processes that log to the journal write their unit identifier to journald when the connection to /run/systemd/journal/stdout is opened. Journald stores the unit ID and uses it to fill in _SYSTEMD_UNIT when it cannot be obtained normally (i.e. from the cgroup). To prevent impersonating another unit, this information is only used when the caller is root. This doesn't fix the general problem of getting metadata about messages from terminated processes (which requires some kernel support), but it allows "systemctl status" and similar queries to do the Right Thing for units that log via stdout/stderr.
2012-06-15service: timeout for oneshot servicesLukas Nykryn
Add possibility to specify timeout for oneshot services. [ https://bugzilla.redhat.com/show_bug.cgi?id=761656 Added minor fixups. -- michich ]
2012-05-24service: for Type=idle units consider START_PRE, START, START_POST all as ACTIVELennart Poettering
We want to avoid a deadlock when a service has ExecStartPre= programs that wait for the job queue to run empty because of Type=idle, but which themselves keep the queue non-empty because START_PRE was considered ACTIVATING and hence the job not complete. With this patch we alter the state translation table so that it is impossible ever to wait for Type=idle unit, hence removing the deadlock.