Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SickRage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
SickRage
Commits
a0b116cd
Commit
a0b116cd
authored
Nov 23, 2014
by
echel0n
Browse files
Options
Downloads
Plain Diff
Merge pull request #936 from josh4trunks/master
Fixed up FreeBSD init file to use rc.subr
parents
b181233f
443b8859
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
init.freebsd
+26
-68
26 additions, 68 deletions
init.freebsd
with
26 additions
and
68 deletions
init.freebsd
+
26
−
68
View file @
a0b116cd
...
@@ -13,25 +13,14 @@
...
@@ -13,25 +13,14 @@
# you want it to be. It uses '_sabnzbd' user by
# you want it to be. It uses '_sabnzbd' user by
# default. Do not sets it as empty or it will run
# default. Do not sets it as empty or it will run
# as root.
# as root.
# sickbeard_group: The group account SickRage daemon runs as what
# you want it to be. It uses '_sabnzbd' group by
# default. Do not sets it as empty or it will run
# as wheel.
# sickbeard_dir: Directory where SickRage lives.
# sickbeard_dir: Directory where SickRage lives.
# Default: /usr/local/sickbeard
# Default: /usr/local/sickbeard
# sickbeard_chdir: Change to this directory before running SickRage.
# Default is same as sickbeard_dir.
# sickbeard_datadir: Data directory for Sick Beard (DB, Logs, config)
# sickbeard_datadir: Data directory for Sick Beard (DB, Logs, config)
# Default is same as sickbeard_chdir
# Default is same as sickbeard_dir
# sickbeard_pid: The name of the pidfile to create.
# Default is sickbeard.pid in sickbeard_dir.
# sickbeard_host: The hostname or IP SickRage is listening on
# Default is 127.0.0.1
# sickbeard_port: The port SickRage is listening on
# Default is 8081
# sickbeard_web_user: Username to authenticate to the SickRage web interface
# Default is an empty string (no username)
# sickbeard_web_password: Password to authenticate to the SickRage web interface
# Default is an empty string (no password)
# sickbeard_webroot: Set to value of web_root in config (for proxies etc)
# Default is an empty string (if set must start with a "/")
PATH
=
"/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
.
/etc/rc.subr
.
/etc/rc.subr
...
@@ -42,57 +31,26 @@ load_rc_config ${name}
...
@@ -42,57 +31,26 @@ load_rc_config ${name}
:
${
sickbeard_enable
:
=
"NO"
}
:
${
sickbeard_enable
:
=
"NO"
}
:
${
sickbeard_user
:
=
"_sabnzbd"
}
:
${
sickbeard_user
:
=
"_sabnzbd"
}
:
${
sickbeard_group
:
=
"_sabnzbd"
}
:
${
sickbeard_dir
:
=
"/usr/local/sickbeard"
}
:
${
sickbeard_dir
:
=
"/usr/local/sickbeard"
}
:
${
sickbeard_chdir
:
=
"
${
sickbeard_dir
}
"
}
:
${
sickbeard_datadir
:
=
"
${
sickbeard_dir
}
"
}
:
${
sickbeard_datadir
:
=
"
${
sickbeard_chdir
}
"
}
:
${
sickbeard_pid
:
=
"
${
sickbeard_dir
}
/sickbeard.pid"
}
pidfile
=
"/var/run/sickbeard/sickbeard.pid"
:
${
sickbeard_host
:
=
"127.0.0.1"
}
command
=
"/usr/local/bin/python2.7"
:
${
sickbeard_port
:
=
"8081"
}
command_args
=
"
${
sickbeard_dir
}
/SickBeard.py --datadir
${
sickbeard_datadir
}
-d --pidfile
${
pidfile
}
--quiet --nolaunch"
:
${
sickbeard_web_user
:
=
""
}
:
${
sickbeard_web_password
:
=
""
}
start_precmd
=
"sickbeard_prestart"
:
${
sickbeard_webroot
:
=
""
}
sickbeard_prestart
()
{
if
[
-f
${
pidfile
}
]
;
then
status_cmd
=
"
${
name
}
_status"
rm
-f
${
pidfile
}
stop_cmd
=
"
${
name
}
_stop"
echo
"Removing stale pidfile."
elif
[
!
-d
${
pidfile
%/*
}
]
;
then
command
=
"/usr/sbin/daemon"
install
-d
-o
${
sickbeard_user
}
-g
${
sickbeard_group
}
${
pidfile
%/*
}
command_args
=
"-f -p
${
sickbeard_pid
}
python
${
sickbeard_dir
}
/SickBeard.py --quiet --nolaunch"
# Add datadir to the command if set
[
!
-z
"
${
sickbeard_datadir
}
"
]
&&
\
command_args
=
"
${
command_args
}
--datadir
${
sickbeard_datadir
}
"
# Ensure user is root when running this script.
if
[
`
id
-u
`
!=
"0"
]
;
then
echo
"Oops, you should be root before running this!"
exit
1
fi
fi
verify_sickbeard_pid
()
{
if
[
!
-d
${
sickbeard_datadir
}
]
;
then
# Make sure the pid corresponds to the SickRage process.
install
-d
-o
${
sickbeard_user
}
-g
${
sickbeard_group
}
${
sickbeard_datadir
}
pid
=
`
cat
${
sickbeard_pid
}
2>/dev/null
`
ps
-p
${
pid
}
2>/dev/null |
grep
-q
"python
${
sickbeard_dir
}
/SickBeard.py"
return
$?
}
# Try to stop SickRage cleanly by calling shutdown over http.
sickbeard_stop
()
{
echo
"Stopping
$name
"
verify_sickbeard_pid
sickbeard_url
=
"
${
sickbeard_host
}
:
${
sickbeard_port
}
"
[
!
-z
"
${
sickbeard_web_user
}
"
]
&&
\
sickbeard_url
=
"
${
sickbeard_web_user
}
:
${
sickbeard_web_password
}
@
${
sickbeard_url
}
"
[
!
-z
"
${
sickbeard_webroot
}
"
]
&&
\
sickbeard_url
=
"
${
sickbeard_url
}${
sickbeard_webroot
}
"
fetch
-o
-
-q
"http://
${
sickbeard_url
}
/home/shutdown/?pid=
${
pid
}
"
>
/dev/null
if
[
-n
"
${
pid
}
"
]
;
then
wait_for_pids
${
pid
}
echo
"Stopped"
fi
fi
}
}
sickbeard_status
()
{
verify_sickbeard_pid
&&
echo
"
$name
is running as
${
pid
}
"
||
echo
"
$name
is not running"
}
run_rc_command
"
$1
"
run_rc_command
"
$1
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment