How to set up the program to boot from Debian

  
                

Debian system to let the program boot from the start, in addition to the program's own boot self-start function, but also manually set up, can be achieved through the editing of the rc.local file, the following small series will give you a detailed introduction to Debian Set the method to start the program from boot.

code is as follows

sudo vi /etc/rc.local

Add software startup command before exit 0. Such as:

/usr/local/bin/sslocal -c /etc/shadowsocks.json

Save the file and restart the system to take effect

If someone wants to put the service Add it to us. Refer to the following method

Adding a self-starting service

1. Creating a new script file

Adding a script file under /etc/init.d

The code is as follows

sudo vi /etc/init.d/aria2c

Input:

#! /bin/sh

### BEGIN INIT INFO

# Provides: Aria2

# Required-Start: $network $local_fs $remote_fs

# Required-Stop:: $network $local_fs $remote_fs

# Should-Start: $all

# Should-Stop: $all

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Aria2 - Download Manager

# Description: Aria2 - Download Manager

### END INIT INFO

NAME=aria2c

USER=pi

ARIA2C=/usr/bin/$NAME

PIDFILE=/var/Run/$NAME.pid

CONF=/home/$USER/.aria2/aria2.conf

ARGS=“--conf-path=${CONF}”

test -f $ARIA2C

Copyright © Windows knowledge All Rights Reserved