Run program (shell script?) at login

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
FirebirdTN
Level 2
Level 2
Posts: 57
Joined: Mon Mar 10, 2014 8:15 pm

Run program (shell script?) at login

Post by FirebirdTN »

I'm trying to run a program (I think its a script) when I login.

I've added it to the startup applications, and it IS marked as executable. It just doesn't work. Works fine starting it manually.

Specifically, I am trying to start this application:

https://sourceforge.net/projects/x360mediaserve/

The longer version:

I'm trying to be able to listen to online streaming audio (specifically SOMAFM, not Pandora, iheart, or any of those other readily available 'aps') on my Xbox360 which is in my living room.

Used to do it with Twonkey back when I was a Windows user. I've ditched TwonkeyMedia for serveral reasons.

I have a dedicated media server, but the 360 won't play internet streams from it (via pls or m3u files). I've tried PlexMediaServer. I've tried mediatomb. This one (x360mediaserver) is EXACTLY what I was looking for, and it works perfectly! I know, I should not trust applications downloaded off the internet, but it is exactly what I have been looking for.

So what am I doing wrong?

-Alan

Mute Ant
Level 14
Level 14
Posts: 5132
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Run program (shell script?) at login

Post by Mute Ant »

Sourceforge is a 'name' though, it's at least traceable. Any chance of posting the text of your script with the startup command you use, so we can see it? You really don't want a list of things you might have got wrong.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

FirebirdTN
Level 2
Level 2
Posts: 57
Joined: Mon Mar 10, 2014 8:15 pm

Re: Run program (shell script?) at login

Post by FirebirdTN »

Here is what I have for the command line in "startup applications":

/home/alan/x360mediaserve-0.0.2/start

And here is the text of the script:

#!/bin/bash
java -cp x360mediaserve.jar:lib/cyberlink/clink170.jar:lib/cyberlink/cmgatejava120.jar:lib/jetty/commons-logging.jar:lib/entagged/entagged-audioformats-0.15.jar:lib/jetty/servlet-api-2.5-6.0.1.jar:lib/jetty/jetty-6.0.1.jar:lib/jetty/jetty-util-6.0.1.jar:lib/xerces/xercesImpl.jar:lib/xerces/xml-apis.jar:lib/cyberlink/clinkwrap.jar Run $1

-Alan

User avatar
WharfRat
Level 21
Level 21
Posts: 13900
Joined: Thu Apr 07, 2011 8:15 pm

Re: Run program (shell script?) at login

Post by WharfRat »

Try changing it to

Code: Select all

sleep 40s && /home/alan/x360mediaserve-0.0.2/start
It might be kicking too early.
ImageImage

Mute Ant
Level 14
Level 14
Posts: 5132
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Run program (shell script?) at login

Post by Mute Ant »

I will take your word that the script works from a shell, but the Startup Application part may be expecting to run a real machine-code binary, not something to be interpreted...that is, the #! is something recognised by bash (when you type it in), but bash isn't running (during Startup Applications). What happens with...

Code: Select all

bash "/home/alan/x360mediaserve-0.0.2/start"
...as the Startup Command?

Since all scripts can be rearranged into a single line, you can, if you like, put the whole thing in the command itself...no script needed. I use this as a Startup Command to reverse the automatic mounting of my Private folder...

Code: Select all

bash -c "sleep 30 && ecryptfs-umount-private"
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

FirebirdTN
Level 2
Level 2
Posts: 57
Joined: Mon Mar 10, 2014 8:15 pm

Re: Run program (shell script?) at login

Post by FirebirdTN »

I tried both your suggestions (adding the startup delay) and trying to run "bash "path to script", and neither worked.

Its not a big deal. I can always start it manually-I'm just being lazy :D

It might be easier to start it when the PC boots up, but doubt it would work that way (since it relies on Java and/or FOSS alternative) it would probably start too early in the boot process. Would be nice if I can find a way to get it to run after my user account logs in, but if its not possible with a bash script its okay.

Thanks for the help!

-Alan

Post Reply

Return to “Newbie Questions”