Updated init scripts a little

This commit is contained in:
Bas Stottelaar
2014-06-02 10:24:18 +02:00
parent 19c4e7d7d3
commit 5064beffe9
4 changed files with 25 additions and 24 deletions

View File

@@ -38,7 +38,7 @@ status_cmd="${name}_status"
stop_cmd="${name}_stop"
command="/usr/sbin/daemon"
command_args="-f -p ${headphones_pid} python ${headphones_dir}/Headphones.py ${headphones_flags} --quiet"
command_args="-f -p ${headphones_pid} python ${headphones_dir}/Headphones.py ${headphones_flags} --quiet --nolaunch"
# Ensure user is root when running this script.
if [ `id -u` != "0" ]; then

View File

@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.headphones.headphones</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python</string>
<string>/Applications/Headphones/headphones.py</string>
<string>-q</string>
<string>-d</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.headphones.headphones</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python</string>
<string>/Applications/Headphones/headphones.py</string>
<string>--quiet</string>
<string>--daemon</string>
<string>--nolaunch</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

View File

@@ -7,7 +7,7 @@
<service name="application/headphones" type="service" version="1">
<create_default_instance enabled="true"/>
<single_instance/>
<dependency name="network" grouping="require_all" restart_on="error" type="service">
@@ -22,7 +22,7 @@
<method_credential user="sabnzbd" group="sabnzbd"/>
</method_context>
<exec_method type="method" name="start" exec="python /opt/headphones/Headphones.py -d" timeout_seconds="60"/>
<exec_method type="method" name="start" exec="python /opt/headphones/Headphones.py --daemon --quiet --nolaunch" timeout_seconds="60"/>
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
@@ -30,8 +30,8 @@
<propval name="duration" type="astring" value="contract"/>
<propval name="ignore_error" type="astring" value="core,signal"/>
</property_group>
<stability value="Evolving"/>
<template>

View File

@@ -4,10 +4,10 @@
## Edit user configuation in /etc/default/headphones to change
##
## Make sure init script is executable
## sudo chmod +x /opt/headphones/init.ubuntu
## sudo chmod +x /path/to/init.ubuntu
##
## Install the init script
## sudo ln -s /opt/headphones/init.ubuntu /etc/init.d/headphones
## sudo ln -s /path/to/init.ubuntu /etc/init.d/headphones
##
## Create the headphones daemon user:
## sudo adduser --system --no-create-home headphones