1
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
noinst_SCRIPTS = pbs_server.service pbs_mom.service pbs_sched.service trqauthd.service
|
||||
|
||||
CLEANFILES = pbs_server.service pbs_mom.service pbs_sched.service trqauthd.service
|
||||
EXTRA_DIST = pbs_server.service.in pbs_mom.service.in pbs_sched.service.in trqauthd.service.in
|
||||
|
||||
edit_systemd_scripts = sed \
|
||||
-e "s|@sbindir[@]|$(sbindir)|g" \
|
||||
-e "s|@bindir[@]|$(bindir)|g" \
|
||||
-e "s|@PBS_HOME[@]|$(PBS_SERVER_HOME)|g"
|
||||
|
||||
pbs_server.service pbs_mom.service pbs_sched.service trqauthd.service: Makefile
|
||||
rm -f $@ $@.tmp
|
||||
my_srcdir=''; \
|
||||
test -f ./$@.in || my_srcdir=$(srcdir)/; \
|
||||
$(edit_systemd_scripts) $${my_srcdir}$@.in >$@.tmp
|
||||
chmod a-w $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
pbs_server.service: $(srcdir)/pbs_server.service.in
|
||||
pbs_mom.service: $(srcdir)/pbs_mom.service.in
|
||||
trqauthd.service: $(srcdir)/trqauthd.service.in
|
||||
pbs_sched.service: $(srcdir)/pbs_sched.service.in
|
||||
@@ -0,0 +1,36 @@
|
||||
[Unit]
|
||||
Description=TORQUE pbs_mom daemon
|
||||
Requires=network.target local-fs.target
|
||||
Wants=syslog.target
|
||||
After=network.target local-fs.target syslog.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
|
||||
Delegate=yes
|
||||
|
||||
LimitNOFILE=32768
|
||||
LimitMEMLOCK=infinity
|
||||
LimitSTACK=12582912
|
||||
LimitCORE=infinity
|
||||
|
||||
Environment=PBS_HOME=@PBS_HOME@
|
||||
Environment=PBS_ARGS=
|
||||
EnvironmentFile=-/etc/sysconfig/pbs_mom
|
||||
|
||||
ExecStart=@sbindir@/pbs_mom -F -d $PBS_HOME $PBS_ARGS
|
||||
|
||||
KillMode=process
|
||||
|
||||
# attempt graceful shutdown
|
||||
ExecStop=/bin/bash -c " \
|
||||
for i in {1..5}; do \
|
||||
kill -0 $MAINPID &>/dev/null || exit 0; \
|
||||
@sbindir@/momctl -s && exit; \
|
||||
sleep 1; \
|
||||
done \
|
||||
"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=TORQUE pbs_sched daemon
|
||||
Requires=network.target local-fs.target
|
||||
Wants=syslog.target
|
||||
After=network.target local-fs.target syslog.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
User=root
|
||||
|
||||
# Do not set PIDFile via enviroment PBS_HOME
|
||||
# better to change to PIDFile=/var/run/%i.pid
|
||||
# and cleanup all code that relies on the current location of the PIDFile
|
||||
PIDFILE=@PBS_HOME@/sched_priv/sched.lock
|
||||
|
||||
Environment=PBS_HOME=@PBS_HOME@
|
||||
Environment=PBS_ARGS=
|
||||
EnvironmentFile=-/etc/sysconfig/pbs_sched
|
||||
|
||||
ExecStart=@sbindir@/pbs_sched -d $PBS_HOME $PBS_ARGS
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,43 @@
|
||||
[Unit]
|
||||
Description=TORQUE pbs_server daemon
|
||||
Requires=network.target local-fs.target
|
||||
Wants=rsyslog.target
|
||||
After=trqauthd.service network.target local-fs.target rsyslog.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
|
||||
LimitCORE=infinity
|
||||
|
||||
# Let systemd guess the pid.
|
||||
#
|
||||
# PIDFile should not be set to PBS_HOME/server_priv/server.lock
|
||||
# since it holds the pid of pbs_server on the active server (not the necessarily
|
||||
# the local one) in an HA configuration.
|
||||
GuessMainPID=yes
|
||||
|
||||
# There is also no way to test PBS_SERVERDB as was done in the sysvinit
|
||||
# because the location can be changed via PBS_HOME enviroment.
|
||||
# However, if you use the PBS_HOME as defined during compilation,
|
||||
# you can create a unit /etc/systemd/system/pbs_server.service.d/test_serverdb.conf
|
||||
# with content
|
||||
#[Unit]
|
||||
#ConditionPathExists=@PBS_HOME@/server_priv/serverdb
|
||||
|
||||
Environment=PBS_HOME=@PBS_HOME@
|
||||
Environment=PBS_ARGS=
|
||||
EnvironmentFile=-/etc/sysconfig/pbs_server
|
||||
|
||||
ExecStart=@sbindir@/pbs_server -F -d $PBS_HOME $PBS_ARGS
|
||||
|
||||
# Define kill parameters for shutdown.
|
||||
#
|
||||
# The server should be shutdown with a SIGTERM rather than using qterm
|
||||
# (which will shutdown the active server in an HA configuration).
|
||||
KillMode=control-group
|
||||
KillSignal=SIGTERM
|
||||
TimeoutStopSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=TORQUE trqauthd daemon
|
||||
Requires=network.target local-fs.target
|
||||
Wants=syslog.target
|
||||
After=network.target local-fs.target syslog.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
|
||||
LimitCORE=infinity
|
||||
|
||||
ExecStart=@sbindir@/trqauthd -F
|
||||
ExecStop=-@sbindir@/trqauthd -d
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user