mirror of
https://github.com/dschmenk/apple2pi.git
synced 2024-05-31 20:41:32 +00:00
Add service install for systemd
This commit is contained in:
parent
e0b6886a67
commit
c1371f42b9
4
debian/a2pi.default
vendored
4
debian/a2pi.default
vendored
|
@ -8,5 +8,5 @@
|
||||||
|
|
||||||
# Additional options that are passed to the Daemon.
|
# Additional options that are passed to the Daemon.
|
||||||
# If you are not using the default serial port /dev/ttyAMA0, enter it here.
|
# If you are not using the default serial port /dev/ttyAMA0, enter it here.
|
||||||
# DAEMON_OPTS="/dev/ttyUSB0"
|
# A2PID_OPTS="/dev/ttyUSB0"
|
||||||
DAEMON_OPTS=""
|
A2PID_OPTS=""
|
||||||
|
|
2
debian/init.d
vendored
2
debian/init.d
vendored
|
@ -49,7 +49,7 @@ do_start()
|
||||||
#start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1
|
#start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1
|
||||||
#start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2
|
#start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2
|
||||||
killall -HUP $NAMED
|
killall -HUP $NAMED
|
||||||
$DAEMON $DAEMON_ARGS $DAEMON_OPTS || return 2
|
$DAEMON $DAEMON_ARGS $A2PID_OPTS || return 2
|
||||||
# Add code here, if necessary, that waits for the process to be ready
|
# Add code here, if necessary, that waits for the process to be ready
|
||||||
# to handle requests from services started subsequently which depend
|
# to handle requests from services started subsequently which depend
|
||||||
# on this one. As a last resort, sleep for some time.
|
# on this one. As a last resort, sleep for some time.
|
||||||
|
|
50
debian/postinst
vendored
50
debian/postinst
vendored
|
@ -81,54 +81,12 @@ case "$1" in
|
||||||
echo "deb http://schmenk.is-a-geek.com/raspbian jessie contrib" >> /etc/apt/sources.list
|
echo "deb http://schmenk.is-a-geek.com/raspbian jessie contrib" >> /etc/apt/sources.list
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# Remove old install
|
# Add a2pi service to systemd
|
||||||
#
|
#
|
||||||
if [ -f /usr/local/bin/a2pid ] ; then
|
if [ -f /usr/local/bin/a2pid ] ; then
|
||||||
rm /usr/local/bin/a2pid
|
cp /usr/share/a2pi/a2pi.service /lib/systemd/
|
||||||
fi
|
systemctl enable a2pi
|
||||||
if [ -f /usr/local/bin/a2serclk ] ; then
|
systemctl reload a2pi
|
||||||
rm /usr/local/bin/a2serclk
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/a2mon ] ; then
|
|
||||||
rm /usr/local/bin/a2mon
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/dskread ] ; then
|
|
||||||
rm /usr/local/bin/dskread
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/dskwrite ] ; then
|
|
||||||
rm /usr/local/bin/dskwrite
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/a2term ] ; then
|
|
||||||
rm /usr/local/bin/a2term
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/fusea2pi ] ; then
|
|
||||||
rm /usr/local/bin/fusea2pi
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/a2joy ] ; then
|
|
||||||
rm /usr/local/bin/a2joy
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/a2joymou ] ; then
|
|
||||||
rm /usr/local/bin/a2joymou
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/a2joypad ] ; then
|
|
||||||
rm /usr/local/bin/a2joypad
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/a2mount ] ; then
|
|
||||||
rm /usr/local/bin/a2mount
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/bload ] ; then
|
|
||||||
rm /usr/local/bin/bload
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/bin/brun ] ; then
|
|
||||||
rm /usr/local/bin/brun
|
|
||||||
fi
|
|
||||||
if [ -f /usr/local/sbin/a2pid ] ; then
|
|
||||||
rm /usr/local/sbin/a2pid
|
|
||||||
fi
|
|
||||||
if [ "$(grep a2pid /etc/rc.local)" != "" ] ; then
|
|
||||||
mv /etc/rc.local /etc/rc.local.old
|
|
||||||
sed -e '/^# Start Apple II Pi/d' -e '/a2pid/d' -e '/^wait 1/d' -e '/a2joy/'d /etc/rc.local.old > /etc/rc.local
|
|
||||||
rm /etc/rc.local.old
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@ After=network.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=idle
|
Type=idle
|
||||||
Environment="HOME=/root"
|
Environment="HOME=/root"
|
||||||
ExecStart=/sbin/a2pid
|
EnvironmentFile=-/etc/default/a2pi
|
||||||
|
ExecStart=/sbin/a2pid $A2PID_OPTS
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=60
|
RestartSec=60
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user