I'm developing/have developed a unit file for systemd
[Unit]
Description=FreeRADIUS multi-protocol policy server
After=syslog.target network.target
Documentation=man:radiusd(8) man:radiusd.conf(5) http://wiki.freeradius.org/ http://networkradius.com/doc/
[Service]
EnvironmentFile=-/etc/sysconfig/radiusd
ExecStartPre=/usr/sbin/radiusd $FREERADIUS_OPTIONS -Cxm -lstdout
ExecStart=/usr/sbin/radiusd $FREERADIUS_OPTIONS -fm
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
Experiencing an issue where calling systemctl radiusd start
does not return an error code, even if /usr/sbin/radiusd -fm
exits with one.
Is there a way to make systemctl act synchronously? i.e. waiting for a set period before returning and indicating the service was successfully/unsuccessfully started.
I'm fine with changing to Type=forking
or any of the other options, like dbus (and writing the code to integrate with dbus) if that means systemctl will exit with an error indicating that the service failed to start.
To pre-empt the obvious question, yes, after start systemd does see the unit as failed.
bash-4.2# systemctl status radiusd
radiusd.service - FreeRADIUS multi-protocol policy server
Loaded: loaded (/usr/lib/systemd/system/radiusd.service; enabled)
Active: failed (Result: start-limit) since Wed 2015-08-12 12:26:18 EDT; 19s ago
Docs: man:radiusd(8)
man:radiusd.conf(5)
http://wiki.freeradius.org/
http://networkradius.com/doc/
Process: 10610 ExecStart=/usr/sbin/radiusd $FREERADIUS_OPTIONS -fm (code=exited, status=1/FAILURE)
Main PID: 10610 (code=exited, status=1/FAILURE)
and yes systemctl status radiusd
does return a non 0 exit code. Just annoying to integrate this with salt stack. Currently, without synchronous start, the bundled saltstack pkg
module reports the service as running, after applying config/code updates that cause service failures.