summarylogtreecommitdiffstats
path: root/template.initd
blob: 79f4294250575697f7c3df0562a050aa81ebf096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/sbin/openrc-run 

# The order doesn't matter.

# Execute this program at start.
command="[absolute_path_to_command]"
# Because every distro can change the bindir, is a good idea specify the system value of bindir.
command=@bindir@/[command]

# Execute the above program with this arguments.
command_args="[args]"

# Create the PID file (for statsu function) in this absolute path.
pidfile="[absolute_path_to_PID]"
# Since OpenRC service names must be unique, a value of
pidfile="/var/run/${RC_SVCNAME}.pid"


# If the daemon runs in the foreground by default but has options to background itself and to create a pidfile, then you'll also need specifie this.
# Usually the argument is; --daemon but can change.
command_args_background="[args]"

# Programs name
name=[name]

# Dependencies, are specified by others services
depend() {
	# NET; They are not satisfied by the loopback interface, so "need net" requires some other interface to be up.
	need net
	use dns logger netmount
}

# If the program dont create the PID you can specify to OpenRC for create it.
command_background=true

# If your daemon doesn't know how to change its own user or group, then you can tell start-stop-daemon to launch it as an unprivileged user with
command_user="user:group"