mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 07:54:01 +01:00
Updated init scripts a little
This commit is contained in:
@@ -38,7 +38,7 @@ status_cmd="${name}_status"
|
|||||||
stop_cmd="${name}_stop"
|
stop_cmd="${name}_stop"
|
||||||
|
|
||||||
command="/usr/sbin/daemon"
|
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.
|
# Ensure user is root when running this script.
|
||||||
if [ `id -u` != "0" ]; then
|
if [ `id -u` != "0" ]; then
|
||||||
|
|||||||
+18
-17
@@ -1,17 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>Label</key>
|
<key>Label</key>
|
||||||
<string>com.headphones.headphones</string>
|
<string>com.headphones.headphones</string>
|
||||||
<key>ProgramArguments</key>
|
<key>ProgramArguments</key>
|
||||||
<array>
|
<array>
|
||||||
<string>/usr/bin/python</string>
|
<string>/usr/bin/python</string>
|
||||||
<string>/Applications/Headphones/headphones.py</string>
|
<string>/Applications/Headphones/headphones.py</string>
|
||||||
<string>-q</string>
|
<string>--quiet</string>
|
||||||
<string>-d</string>
|
<string>--daemon</string>
|
||||||
</array>
|
<string>--nolaunch</string>
|
||||||
<key>RunAtLoad</key>
|
</array>
|
||||||
<true/>
|
<key>RunAtLoad</key>
|
||||||
</dict>
|
<true/>
|
||||||
</plist>
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<service name="application/headphones" type="service" version="1">
|
<service name="application/headphones" type="service" version="1">
|
||||||
|
|
||||||
<create_default_instance enabled="true"/>
|
<create_default_instance enabled="true"/>
|
||||||
|
|
||||||
<single_instance/>
|
<single_instance/>
|
||||||
|
|
||||||
<dependency name="network" grouping="require_all" restart_on="error" type="service">
|
<dependency name="network" grouping="require_all" restart_on="error" type="service">
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<method_credential user="sabnzbd" group="sabnzbd"/>
|
<method_credential user="sabnzbd" group="sabnzbd"/>
|
||||||
</method_context>
|
</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"/>
|
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
|
||||||
|
|
||||||
@@ -30,8 +30,8 @@
|
|||||||
<propval name="duration" type="astring" value="contract"/>
|
<propval name="duration" type="astring" value="contract"/>
|
||||||
<propval name="ignore_error" type="astring" value="core,signal"/>
|
<propval name="ignore_error" type="astring" value="core,signal"/>
|
||||||
</property_group>
|
</property_group>
|
||||||
|
|
||||||
|
|
||||||
<stability value="Evolving"/>
|
<stability value="Evolving"/>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
## Edit user configuation in /etc/default/headphones to change
|
## Edit user configuation in /etc/default/headphones to change
|
||||||
##
|
##
|
||||||
## Make sure init script is executable
|
## Make sure init script is executable
|
||||||
## sudo chmod +x /opt/headphones/init.ubuntu
|
## sudo chmod +x /path/to/init.ubuntu
|
||||||
##
|
##
|
||||||
## Install the init script
|
## 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:
|
## Create the headphones daemon user:
|
||||||
## sudo adduser --system --no-create-home headphones
|
## sudo adduser --system --no-create-home headphones
|
||||||
|
|||||||
Reference in New Issue
Block a user