forked from pool/powerman
Egbert Eich
3b6d25eadd
Now using powerman:powerman user for systemd service and daemon OBS-URL: https://build.opensuse.org/request/show/503994 OBS-URL: https://build.opensuse.org/package/show/hardware/powerman?expand=0&rev=35
97 lines
2.6 KiB
Diff
97 lines
2.6 KiB
Diff
Index: powerman-2.3.24/scripts/powerman.service
|
|
===================================================================
|
|
--- powerman-2.3.24.orig/scripts/powerman.service
|
|
+++ /dev/null
|
|
@@ -1,16 +0,0 @@
|
|
-[Unit]
|
|
-Description=PowerMan
|
|
-After=syslog.target network.target
|
|
-
|
|
-[Service]
|
|
-Type=forking
|
|
-PrivateTmp=yes
|
|
-User=daemon
|
|
-Group=daemon
|
|
-ExecStart=/usr/sbin/powermand
|
|
-RuntimeDirectory=powerman
|
|
-RuntimeDirectoryMode=0755
|
|
-PIDFile=/var/run/powerman/powermand.pid
|
|
-
|
|
-[Install]
|
|
-WantedBy=multi-user.target
|
|
Index: powerman-2.3.24/scripts/powerman.service.in
|
|
===================================================================
|
|
--- /dev/null
|
|
+++ powerman-2.3.24/scripts/powerman.service.in
|
|
@@ -0,0 +1,16 @@
|
|
+[Unit]
|
|
+Description=PowerMan
|
|
+After=syslog.target network.target
|
|
+
|
|
+[Service]
|
|
+Type=forking
|
|
+PrivateTmp=yes
|
|
+User=@RUN_AS_USER@
|
|
+Group=@RUN_AS_GROUP@
|
|
+ExecStart=/usr/sbin/powermand
|
|
+RuntimeDirectory=powerman
|
|
+RuntimeDirectoryMode=0755
|
|
+PIDFile=/var/run/powerman/powermand.pid
|
|
+
|
|
+[Install]
|
|
+WantedBy=multi-user.target
|
|
Index: powerman-2.3.24/configure.ac
|
|
===================================================================
|
|
--- powerman-2.3.24.orig/configure.ac
|
|
+++ powerman-2.3.24/configure.ac
|
|
@@ -91,7 +91,7 @@ AC_DEFINE(WITH_LSD_NOMEM_ERROR_FUNC, 1,
|
|
# whether to install pkg-config file for API
|
|
AC_PKGCONFIG
|
|
|
|
-# what user to run daemon as
|
|
+# what user and group to run daemon as
|
|
AC_RUNAS
|
|
|
|
##
|
|
@@ -112,6 +112,7 @@ AC_CONFIG_FILES( \
|
|
etc/Makefile \
|
|
scripts/Makefile \
|
|
scripts/powerman \
|
|
+ scripts/powerman.service \
|
|
heartbeat/Makefile \
|
|
man/Makefile \
|
|
man/powerman.1 \
|
|
Index: powerman-2.3.24/config/ac_runas.m4
|
|
===================================================================
|
|
--- powerman-2.3.24.orig/config/ac_runas.m4
|
|
+++ powerman-2.3.24/config/ac_runas.m4
|
|
@@ -1,6 +1,7 @@
|
|
AC_DEFUN([AC_RUNAS],
|
|
[
|
|
RUN_AS_USER="daemon"
|
|
+ RUN_AS_GROUP="daemon"
|
|
AC_MSG_CHECKING(user to run as)
|
|
AC_ARG_WITH(user,
|
|
AC_HELP_STRING([--with-user=username], [user for powerman daemon (daemon)]),
|
|
@@ -16,4 +17,20 @@ AC_DEFUN([AC_RUNAS],
|
|
[Powerman daemon user])
|
|
AC_MSG_RESULT(${RUN_AS_USER})
|
|
AC_SUBST(RUN_AS_USER)
|
|
+
|
|
+ AC_MSG_CHECKING(group to run as)
|
|
+ AC_ARG_WITH(group,
|
|
+ AC_HELP_STRING([--with-group=groupname], [group for powerman daemon (daemon)]),
|
|
+ [ case "${withval}" in
|
|
+ yes|no)
|
|
+ ;;
|
|
+ *)
|
|
+ RUN_AS_GROUP="${withval}"
|
|
+ ;;
|
|
+ esac],
|
|
+ )
|
|
+ AC_DEFINE_UNQUOTED(RUN_AS_GROUP, "${RUN_AS_GROUP}",
|
|
+ [Powerman daemon group])
|
|
+ AC_MSG_RESULT(${RUN_AS_GROUP})
|
|
+ AC_SUBST(RUN_AS_GROUP)
|
|
])
|