Skip to content

Commit

Permalink
systemd: run as Type=simple
Browse files Browse the repository at this point in the history
Problem: powermand runs as a Type=forking systemd service,
but Type=simple is recommended by systemd.service(5).

Switch to Type=simple (the default).

Drop the tmpfiles.d configuration which was for managing
/run/powerman on systemd < v233 (now ancient).  Powerman doesn't
need the rundir anyway when not running in daemon mode, since all
it does is store a pidfile there.

Fixes chaos#13
  • Loading branch information
garlick committed Jan 31, 2024
1 parent bae274c commit ed27e73
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ AC_CONFIG_FILES( \
etc/Makefile \
etc/libpowerman.pc \
etc/powerman.service \
etc/tmpfiles.d/powerman.conf \
heartbeat/Makefile \
man/Makefile \
man/powerman.1 \
Expand Down
2 changes: 0 additions & 2 deletions etc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
if HAVE_SYSTEMD
systemdsystemunit_DATA = powerman.service
systemdtmpdir_ddir = ${prefix}/lib/tmpfiles.d
systemdtmpdir_d_DATA = tmpfiles.d/powerman.conf
endif

if WITH_PKG_CONFIG
Expand Down
4 changes: 1 addition & 3 deletions etc/powerman.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ After=syslog.target network.target

[Service]
Environment=SHELL=/bin/sh
Type=forking
PrivateTmp=yes
User=@RUN_AS_USER@
Group=@RUN_AS_GROUP@
ExecStart=@X_SBINDIR@/powermand
PIDFile=@X_RUNSTATEDIR@/powerman/powermand.pid
ExecStart=@X_SBINDIR@/powermand -f

[Install]
WantedBy=multi-user.target
1 change: 0 additions & 1 deletion etc/tmpfiles.d/powerman.conf.in

This file was deleted.

0 comments on commit ed27e73

Please sign in to comment.