Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create process control scripts for Windows/Linux #17

Open
jesseward opened this issue Oct 9, 2014 · 5 comments
Open

Create process control scripts for Windows/Linux #17

jesseward opened this issue Oct 9, 2014 · 5 comments

Comments

@jesseward
Copy link
Owner

  • Create an upstart script stop/start the PLS daemon at boot/shutdown.
  • investigate options for Windows installations that allow the script to start/stop at boot/shutdown time
@jesseward
Copy link
Owner Author

upstart script added in b070402

@jesseward
Copy link
Owner Author

Leaving open if someone wants to commit OSX or Windows based scripts..

@hale
Copy link

hale commented Jul 10, 2015

Thanks for adding this!

I wonder though if on Linux we should use systemd instead of upstart. That way we could hook into the existing Plex service.

I'm on Fedora, maybe the Ubuntu version of Plex doesn't use systemd?

mkdir /usr/lib/systemd/system/plexmediaserver.service.d

cat <<EOF > /usr/lib/systemd/system/plexmediaserver.service.d/lastfm-scrobbler.conf
[Unit]
Wants=plex.lastfm.scrobbler
After=plex.lastfm.scrobbler
EOF

cat <<EOF > /usr/lib/systemd/system/plex.lastfm.scrobbler.service
[Unit]
Description=Plex Media Server Scrobbler for Last.FM
After=network.target

[Service]
Environment=PLEX_LASTFM_SCROBBLER_HOME=/usr/lib/plexmediaserver
ExecStart=/bin/python "${PLEX_LASTFM_SCROBBLER_HOME}/scripts/plex-scrobbler.py"
User=plex
Group=plex
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target
EOF

This is new to me, there will likely be mistakes - and I'm not sure how to handle sourcing the virtualenv - maybe the Environment should be read from plex_scrobble.conf to get a) the directory for the script and b) the directory for the virtualenv.

Let me know what you think :)

@dannymichel
Copy link

dannymichel commented Aug 10, 2016

upstart script added in b070402
Does this mean you added a way to make this a service?
If so, what are the steps to enabling this service or start-up script?

@sbarrett-dev
Copy link

@dannymichel if you are using a Windows based machine you might check out https://github.com/shiitake/Plax.FM which will run as a service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants