0

I have managed to get the Plex Media Server running on my Chromebook via Crouton and Unity.

The only thing is that it won't load unless I run the command sudo su -c /usr/sbin/start_pms plex

Is there an easy way to run this automatically when I boot into Crouton? This would make my life alot easier.

Thanks guys,

muru
  • 193,181
  • 53
  • 473
  • 722
  • possible duplicate of [How to run scripts on start up?](http://askubuntu.com/questions/814/how-to-run-scripts-on-start-up) – muru Apr 12 '15 at 11:05
  • 1
    Whether you use `upstart`, `/etc/crontab` or `/etc/rc.local`, skip the `sudo su -c` - all three run as root. You shouldn't have to do `su -c` either - `sudo /usr/bin/...` would be just fine. – muru Apr 12 '15 at 11:07
  • There seems to be so many ways to do this but I can't do any, i've made a .conf file with /usr/sbin/start_pms plex inside and i've added it via the menu to Startup applications but it doesn't do anything. It won't let me move the file to etc/init telling me permissions denied. – Mark Dodsworth Apr 12 '15 at 14:20
  • There were so many ways that you combined them all, eh? Pick one and stick with it. At the moment what you did corresponds to three different ways. – muru Apr 12 '15 at 14:37
  • Sorry Muru, i'm really not good with Linux :-( Any advice you can give me is very greatly appreciated. – Mark Dodsworth Apr 12 '15 at 15:31
  • Thanks for your help, I tried all this but it still didn't work after a reboot;https://docs.google.com/file/d/0ByUXeTtKbYTZVmJBOG5FWXQ0WlU/edit?usp=docslist_api any idea what I'm doing wrong? – Mark Dodsworth Apr 12 '15 at 19:53
  • I don't since I have no idea what Plex is. What does the `/var/log/upstart/startplex.log` file contain? – muru Apr 12 '15 at 19:56
  • That folder is empty, no files in it at all? Would there be hidden files in there? Do I have to install Upstart? – Mark Dodsworth Apr 12 '15 at 20:38

1 Answers1

0

For the moment, I'd suggest using upstart. To create an upstart job, create a file called startplex.conf in /etc/init/, containing:

start on startup
task
exec /usr/sbin/start_pms plex

To do this in one command:

sudo tee /etc/init/startplex.conf <<EOF
start on startup
task
exec /usr/sbin/start_pms plex
EOF
muru
  • 193,181
  • 53
  • 473
  • 722