Debian Startup script

Bug #1447730 reported by Spitfire
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ADCH++
Opinion
Undecided
Unassigned

Bug Description

Should work havent tested it yet might be worth while to add into distro

#!/bin/bash
# Init Script for ADCH++

CONF=/etc/adchpp/default.conf
PID=$(ps -A -o pid,cmd|grep adchppd | grep -v grep |head -n 1 | awk '{print $1}')

 case "$1" in
  start)
   printf "Starting ADCH++"
   adchppd -d -c $CONF
    ;;

 stop)
  printf "Stopping ADCH++"
  kill -SIGTERM $PID
    ;;

 enable)
  printf "Enabling ADCH++ Service"
  update-rc.d adchpp defaults
 ;;

 disable)
  printf "Disabling ADCH++ Service"
  update-rc.d -f adchpp remove

 *)
  echo "Usage: /etc/init.d/adchpp {start|stop|enable|disable}"
  exit 1

 ;;

esac
exit 0

Spitfire (b13569b8)
description: updated
description: updated
Changed in adchpp:
status: New → Opinion
Revision history for this message
cologic (cologic) wrote :

I'd be all for adchpp's default distribution including a Debian startup script, and this looks broadly reasonable for https://www.debian.org/releases/wheezy/ and earlier versions. However https://www.debian.org/releases/jessie/ to be released in a couple of days, uses https://wiki.debian.org/systemd instead as its init system.

How would this init script interact with Debian Jessie defaulting to systemd?

Revision history for this message
Spitfire (b13569b8) wrote :

can rework it to check if init.d or system.d is used later on if nessary running on wheezy since jessie has been to unstable but its a minor tweak in config just some if variable thats needed

Revision history for this message
Spitfire (b13569b8) wrote :

[Unit]
Description=ADCH++ Service
After=syslog.target
After=network.target

[Service]
Type=simple
User=<adchpp user>
Group=<adchpp group>
ExecStart=/bin/adchpp -d -c <adchpp home>

# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300

[Install]
WantedBy=multi-user.target

Change <adchpp user> to be the user you want adchpp to run as
Change <adchpp group> to be the group you want adchpp to run as
Change <adchpp home> to be the absolute locate to your adchpp directory
Save the file

to install this service use (as root or sudo)
systemctl enable adchpp.service

to start the service use (as root or sudo)
systemctl start adchpp.service

Logs will be written to /var/log/messages

should be something like this if i read the systemd man correctly :D

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.