OK, thanks for lettings us know that SysVinit script works.
For the record and example:
We take this service files:
tccd.service
Code: Select all
[Unit]
Description=TUXEDO Control Center Service
[Service]
Type=simple
ExecStart=/opt/tuxedo-control-center/resources/dist/tuxedo-control-center/data/service/tccd --start
ExecStop=/opt/tuxedo-control-center/resources/dist/tuxedo-control-center/data/service/tccd --stop
[Install]
WantedBy=multi-user.target
and convert it to an SysVinit script as /etc/init.d/tccd using sysd2v:
e.g like this
./sysd2v-0.3.sh tccd.service | sudo tee /etc/init.d/tccd
Code: Select all
#!/bin/sh
# Generated by sysd2v v0.3 -- http://www.trek.eu.org/devel/sysd2v
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: tccd
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: TUXEDO Control Center Service
### END INIT INFO
DAEMON=/opt/tuxedo-control-center/resources/dist/tuxedo-control-center/data/service/tccd
DAEMON_ARGS="--start"
PIDFILE=/var/run/tccd-sysd2v.pid
START_ARGS="--background --make-pidfile"
do_stop_cmd_override ()
{
/opt/tuxedo-control-center/resources/dist/tuxedo-control-center/data/service/tccd --stop || return 2
do_stop_cmd
true
}
and
make it executable
and install SysVinit script links:
and start tccd sysvinit service with
Next to convert the sleep/resume systemd service,
to an pm-hook this way:
The provide systemd.service
tccd-sleep.service
Code: Select all
[Unit]
Description=TUXEDO Control Center Service (sleep/resume)
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "systemctl stop tccd"
ExecStop=/bin/bash -c "systemctl start tccd"
[Install]
get manually converted based on this pm hook here:
/usr/lib/pm-utils/sleep.d/49tlp
We create a similar pm-hook at
/etc/pm/sleep.d/49tccd
Code: Select all
#!/bin/sh
# copy to /etc/pm/sleep.d/49tccd
#
# tccd - handle suspend/hibernate/resume tasks
# TUXEDO Control Center Service
# adjusted by fehlix at mxlinux dot org
# based on:
# /usr/lib/pm-utils/sleep.d/49tlp
# Copyright (c) 2018 Thomas Koch <linrunner at gmx.net>
# This software is licensed under the GPL v2 or later.
. "${PM_FUNCTIONS}"
case $1 in
hibernate|suspend)
service tccd stop
;;
thaw|resume)
service tccd start
;;
*) exit $NA
;;
esac
exit 0
and make it executable
Code: Select all
sudo chmod +x /etc/pm/sleep.d/49tccd
Perhaps would be nice, if someone could checkout whether this sleep/resume pm-hook
would work with tccd.
Thanks