Skip to content

Install as a daemon

bengalih edited this page Jan 5, 2016 · 38 revisions

These steps are presented as guidelines. Your results may vary, depending on operating system, installation path and other settings.

Ubuntu

This installation assumes Headphones is installed to /opt/headphones. Make sure all paths are correct and accessible. A common mistake is that a daemon user has no read and/or write permissions.

  • cd /opt/headphones
  • sudo touch /etc/default/headphones
  • Optional:
    • sudo adduser --system --no-create-home headphones
    • sudo chown headphones:nogroup -R /opt/headphones
  • Adjust settings in /etc/default/headphones. See the comments in /opt/headphones/init-scripts/init.ubuntu for the list of parameters.
  • sudo chmod +x /opt/headphones/init-scripts/init.ubuntu
  • sudo ln -s /opt/headphones/init-scripts/init.ubuntu /etc/init.d/headphones
  • sudo update-rc.d headphones defaults
  • sudo update-rc.d headphones enable
  • sudo service headphones [start | stop | reload | restart | status]

CentOS / RedHat

This installation assumes Headphones is installed to /home/sabnzbd/headphones. Make sure all paths are correct and accessible. A common mistake is that a daemon user has no read and/or write permissions.

  • sudo adduser --system sabnzbd
  • mkdir /home/sabnzbd
  • mkdir /etc/headphones
  • mkdir -R chown sabnzbd:sabnzbd /home/sabnzbd
  • cd /home/sabnzbd
  • git clone https://github.com/rembo10/headphones.git
  • sudo cp /home/sabnzbd/headphones/init-scripts/init.fedora.centos.systemd /home/sabnzbd/headphones/init-scripts/headphones.service
  • sudo chmod +x /home/sabnzbd/headphones/init-scripts/headphones.service
  • sudo touch /etc/headphones/headphones.ini
  • sudo chown sabnzbd:sabnzbd /etc/headphones/headphones.ini
  • sudo cp /home/sabnzbd/headphones/init-scripts/headphones.service /lib/systemd/system/headphones.service
  • sudo systemctl daemon-reload
  • sudo systemctl enable headphones.service
  • sudo service headphones [start | stop | reload | restart]
  • Browse to http://localhost:8181 to customize

Synology

  • Go to your DSM > Users > Create user and create user headphones
  • chown -R headphones:users /volume1/@appstore/headphones
  • wget -O /opt/etc/init.d/S99headphones.sh http://dl.dropbox.com/u/5653370/syn_files/headphones/S99headphones.sh
  • chmod a+x /opt/etc/init.d/S99headphones.sh
  • /opt/etc/init.d/S99headphones.sh [start | stop | restart | update]

Mac OS X

Tested on Mac OS X 10.8.2. Assumes Headphones is installed to /Applications/Headphones/

  • cp /Applications/Headphones/init-scripts/init.osx ~/Library/LaunchAgents/com.rembo10.headphones.plist (do not symlink!)
  • launchctl [load | unload] ~/Library/LaunchAgents/com.rembo10.headphones.plist

Windows

Tested on Windows 7 (similar process should work on 8+). This method will startup the headphones application even before a Windows user logs in. With Windows 7+ there is no need to mess with srvany, nssm, etc. This assumes you have a working headphones.py.

  • Open up the Window's Task Scheduler application (Taskschd.msc).
  • Right-click on "Task Scheduler Library" and choose "Create Task" (NOT "Create Basic Task").
  • Set the following on each respective tab:
  • General - Set Name to "Headphones". Set Security Options to "Run whether user is logged in or not." Click Change user or group and type "System" in the object name to select. Click "OK"
  • Triggers - Click "New". Under "Begin the Task" select "At startup." Click "OK"
  • Actions - Click "New". Set the script location to your headphones.py file (in double quotes). Click "OK"
  • Conditions - Uncheck all boxes.
  • Settings - Uncheck all boxes except "Allow task to be run on demand."
  • Click "OK" on the new task and supply your administrator credentials.
  • Script can be tested by right-click and Run. You should see a new instance of python appear in your task manager.
Clone this wiki locally