aboutsummaryrefslogtreecommitdiffstats
path: root/testing/otrs/otrs.initd
blob: 5e82854abf4e6f18b36d560e788a5e9d05cdb2e0 (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
40
41
42
#!/sbin/openrc-run

description="Open Ticket Management System"
extra_started_commands="reload status"

otrs_cron=/var/lib/otrs/bin/Cron.sh
otrs_daemon=/var/lib/otrs/bin/otrs.Daemon.pl

depend() {
	need net
	after firewall
}

otrs() {
	[ -n "$2" ] && su -s /bin/sh otrs -c "$(eval echo \$otrs_$1) $2" >/dev/null
}

start() {
	ebegin "Starting $RC_SVCNAME"
	/var/lib/otrs/bin/otrs.SetPermissions.pl --web-group=www-data >/dev/null
	otrs daemon start
	otrs cron start
	eend
}

stop() {
	ebegin "Stopping $RC_SVCNAME"
	otrs daemon stop
	otrs cron stop
	eend
}

reload() {
	ebegin "Reloading $RC_SVCNAME"
	otrs daemon restart
	otrs cron restart
	eend
}

status() {
	otrs daemon status
}