The officially official Devuan Forum!

You are not logged in.

#1 Other Issues » Service for ipp-usb printing » 2023-03-01 23:29:17

king.oslo
Replies: 0

Hello,

I made this thread about devuan at the superuser website: https://superuser.com/questions/1771253 … 56#1771256

I am a bit of a beginner, and trying to implement the service for ipp-usb printing that runs at startup on debian.

As you can see, the people on the website gave me a template for a service script:

#! /bin/bash

### BEGIN INIT INFO
# Provides:          foo
# Required-Start:    $local_fs $network
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: foo service
# Description:       Run Foo service
### END INIT INFO

# Carry out specific functions when asked to by the system
case "$1" in
  start)
    echo "Starting Foo..."
    sudo -u foo-user bash -c 'cd /path/to/scripts/ && ./start-foo.sh'
    ;;
  stop)
    echo "Stopping Foo..."
    sudo -u foo-user bash -c 'cd /path/to/scripts/ && ./stop-foo.sh'
    sleep 2
    ;;
  *)
    echo "Usage: /etc/init.d/foo {start|stop}"
    exit 1
    ;;
esac

exit 0

I realized this was much more difficult than I thought. I was hoping I could simply paste "ipp-usb" in there somewhere and that was it. Therefore, my questions are the following:

1. How can I find out the values that are correct for the block at the top that is commented out? Will the OS provide the values for Required-Start and Required-Stop? What about Default-Start, Default-Stop ?
2. When it comes to the lines for starting and stopping foo; (i) would I write "sudo ipp-usb" in the line that starts the service? And (ii) is it "sudo killall ipp-usb" for the other one?
3. Can i break my OS and unable to boot if I write the script incorrectly?
4. Is there anything else I will need to succeed?

Thanks for your time!

Board footer

Forum Software