Steamcast (and others) with Plesk 8 Crontab

Steamcast is a stand alone server that combines the features of SHOUTcast and Icecast2 and more to make one mega awesome server.
Post Reply
blueice_haller
Posts: 8
Joined: Mon Sep 17, 2007 3:31 am
Location: Germany
Contact:

Steamcast (and others) with Plesk 8 Crontab

Post by blueice_haller »

Hello,

System:
Root Server i686
Suse Linux v10.2
Plesk v8.2.0

Rights:
Normal User
Starting of Steamcast, Shoutcast etc. is possible

Idea:
I want to start (if possible, then stop, too) my Steamcast Server with an Crontab (Cronjob) over the Plesk Interface.

Reason:
Under the week, I work behind a Firewall, where I can't log me into the SSH. I don't want to wait until the weekend, to start the Server, if it is down, for any reason.

Current Testings:
I tried to start the Server with the following Command, but it won't work:
http://tinyurl.com/yv25k3

Update:
Now it work with the following command, to start the Server:

Code: Select all

cd /srv/www/vhosts/mysite.tld/steamcast; ./steamcast > /dev/null &
To stop it, I use the command, that Jay tell in another thread:

Code: Select all

http://yourserver:8000/admin/?shutdown=y
I hope, anybody can help.

Thanks before.
Last edited by blueice_haller on Tue Sep 18, 2007 6:21 am, edited 4 times in total.
sincerely yours, blueice_haller
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

First of all, have you tested running something else with that same method? perhaps a simple "hello world" shell script? (in this case, one that writes hello world to a file you can later read, and check modification time on).

also, whatever user is running cron needs to have execution rights to the binary, and read/write access to the dir. do you know if those are valid?
blueice_haller
Posts: 8
Joined: Mon Sep 17, 2007 3:31 am
Location: Germany
Contact:

Post by blueice_haller »

Lane wrote:First of all, have you tested running something else with that same method? perhaps a simple "hello world" shell script? (in this case, one that writes hello world to a file you can later read, and check modification time on).
No, but I try it, now.
Lane wrote:also, whatever user is running cron needs to have execution rights to the binary, and read/write access to the dir. do you know if those are valid?
I thought, that the user, which I use for SSH access, is the same, who execute crontabs. If this is so, it should work.
sincerely yours, blueice_haller
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

Actually with plesk this is not so, you must specifically login as the user or set the execution to the appropriate level for the plesk user. If you are using it as admin then it would be the admin user.
- Jay
blueice_haller
Posts: 8
Joined: Mon Sep 17, 2007 3:31 am
Location: Germany
Contact:

Post by blueice_haller »

Current testing script:

Code: Select all

#!/bin/sh
# Simple Example
echo Hello, World!
Execution command:
blueicehaller -x /srv/vhosts/mysite.tld/test/test.sh

The user
What to do: -x = Execute ?
The directory, where the script is

Is this correct ? Or do you have a good introduction ? I'm a newby in cronetabs ;)
sincerely yours, blueice_haller
Lane
Posts: 154
Joined: Mon May 09, 2005 4:16 pm

Post by Lane »

your hello world test needs to write to a file, so you'll see the output. try something like this

echo "hello world" > /path/to/steamcastdir/helloworld.txt

I don't know much about plesk, so I can't really help you with it's quirks. But I think you should probably study up on this stuff a little more first, as you need to do a few things.

to have it run:

1) check if it's running

2) if it is, do nothing. if it isn't, start it

to have it stop, similar process.

1) check if it's running

2) stop it. ( you probably want to know it's pid to do that.)

If you can figure out how to do that via your shell prompt, you can probably cron it. Have you cron call a script, instead of executing a single command. You'll need to check and make decisions in the script, more than is comfy on a single line. (looks like you get that part already)

chmod +x test.sh would make your script executable. if you do an ls- l, you should see the permissions for your files.
blueice_haller
Posts: 8
Joined: Mon Sep 17, 2007 3:31 am
Location: Germany
Contact:

Post by blueice_haller »

Is it possible, to add the link I posted, in the Steamcast (v0.9.75 beta) Admin Web Interface ?

Code: Select all

admin/?shutdown=y
sincerely yours, blueice_haller
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

yes at some point it will be added to the interface. I first want to add a few other options such as config reread and restarting.
- Jay
Post Reply