Run Steamcast as daemon
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
Run Steamcast as daemon
Hi !
I've juste set up a steamcast server, which runs fine, but I can't run it as daemon...
I've try with the same script I use for shoutcast, but it doesn't work...
Somebody has already do this ?
Thanks
I've juste set up a steamcast server, which runs fine, but I can't run it as daemon...
I've try with the same script I use for shoutcast, but it doesn't work...
Somebody has already do this ?
Thanks
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
Thanks a lot
I paste my script for everybody:
I paste my script for everybody:
Code: Select all
server:/home/user# more /etc/init.d/steamcast
#!/bin/bash
NAME="Steamcast"
SRV_BIN=/steamcast/steamcast
SRV_CFG=/steamcast/steamcast.conf
# On va faire tourner steamcast en tant que nobody:nogroup
# On peut bien sur creer un autre user (sans shell,...) si on veut, bien sur
SRV_UID=nobody
SRV_GID=nogroup
SSD_BIN=/sbin/start-stop-daemon
SSD_GENERAL_OPTS="--quiet"
case "$1" in
start)
echo "Starting $NAME";
$SSD_BIN $SSD_GENERAL_OPTS --chuid ${SRV_UID}:${SRV_GID} --user $SRV_UID \
--group $SRV_GID --start --background --exec $SRV_BIN $SRV_CFG > /dev/null
;;
stop)
echo "Stopping $NAME";
$SSD_BIN $SSD_GENERAL_OPTS --chuid ${SRV_UID}:${SRV_GID} --user $SRV_UID \
--group $SRV_GID --stop --exec $SRV_BIN $SRV_CFG > /dev/null
;;
restart|force-reload)
echo "Restart";
;;
*)
echo "Usage: {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
Hi,
Just one more question...
I've all my steamcast files in a /steamcast directory...
But authentication doesn't work...
If I launch manually, with ./steamcast steamcast.conf it works fine...
How could I activate authfile with a daemon running steamcast ?
Where must I put steamauth.txt ? Or how could I launch steamcast with specify the steamauth.txt localization ?
Thanks a lot
Just one more question...
I've all my steamcast files in a /steamcast directory...
Code: Select all
server:/steamcast# ll
total 400K
drwxr-xr-x 2 root root 4,0K 2006-09-26 10:48 .
drwxr-xr-x 22 root root 4,0K 2006-09-25 23:12 ..
-rw-r--r-- 1 root root 1003 2006-09-25 21:36 steamauth.txt
-rwxr-xr-x 1 root root 365K 2005-06-24 21:09 steamcast
-rw-r--r-- 1 root root 13K 2006-09-26 10:41 steamcast.conf
If I launch manually, with ./steamcast steamcast.conf it works fine...
How could I activate authfile with a daemon running steamcast ?
Where must I put steamauth.txt ? Or how could I launch steamcast with specify the steamauth.txt localization ?
Thanks a lot
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
hey !Jay wrote:you need to make sure the working directory is set to the steamcast exe's location. such as
cd /pathto/steamcast
What an honor... the admin himself
The problem is that I run Steamcast as daemon, on boot...
(update-rc.d etc...)
How can I do ?
The other way I've try is to launch steamcast using screen...
Code: Select all
cd /pathto/steamcast ; screen -d -m ./steamcast steamcast.conf
An idea ?
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
Mmmhhh...Jay wrote:So how does running as a daemon stop you from changing the current working directory? Just do this in the startup script.
I don't really understand you answer...
You say that I have to put something like this:
Code: Select all
cd /my/path/of/steamcast
Code: Select all
echo "Starting $NAME";
here ?
$SSD_BIN $SSD_GENERAL_OPTS --chuid ${SRV_UID}:${SRV_GID} --user $SRV_UID \
--group $SRV_GID --start --background --exec $SRV_BIN $SRV_CFG > /dev/null
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
Hi !
I've try lot of things, it doesn't work anymore...
In user table, I still have
Thanks
I've try lot of things, it doesn't work anymore...
Code: Select all
server:/home/user# more /etc/init.d/steamcast
#!/bin/bash
NAME="Steamcast"
SRV_BIN=/steamcast/steamcast
SRV_CFG=/steamcast/steamcast.conf
SRV_PATH=/steamcast
# On va faire tourner steamcast en tant que nobody:nogroup
# On peut bien sur creer un autre user (sans shell,...) si on veut, bien sur
SRV_UID=nobody
SRV_GID=nogroup
SSD_BIN=/sbin/start-stop-daemon
SSD_GENERAL_OPTS="--quiet"
case "$1" in
start)
echo "Starting $NAME";
cd $SRV_PATH;
$SSD_BIN $SSD_GENERAL_OPTS --chuid ${SRV_UID}:${SRV_GID} --user $SRV_UID \
--group $SRV_GID --start --background --exec $SRV_BIN $SRV_CFG > /dev/null
;;
stop)
echo "Stopping $NAME";
cd $SRV_PATH;
$SSD_BIN $SSD_GENERAL_OPTS --chuid ${SRV_UID}:${SRV_GID} --user $SRV_UID \
--group $SRV_GID --stop --exec $SRV_BIN $SRV_CFG > /dev/null
;;
restart|force-reload)
echo "Restart";
;;
*)
echo "Usage: {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
Code: Select all
Authenticated Users
User Mount Action
File not found
- Flying Jack
- Posts: 17
- Joined: Mon Sep 25, 2006 4:36 am
- Location: France
- Contact:
I've try lot of different possibilities, the only one which works is:
and
And SteamCast starts on boot, and authfile is recognize...
Code: Select all
server:/home/user# more /etc/init.d/steamcast
#!/bin/bash
NAME="Steamcast"
SCREEN=/usr/local/bin/screen
# On va faire tourner steamcast en tant que nobody:nogroup
# On peut bien sur creer un autre user (sans shell,...) si on veut, bien sur
SRV_UID=nobody
SRV_GID=nogroup
SSD_BIN=/sbin/start-stop-daemon
SSD_GENERAL_OPTS="--quiet"
case "$1" in
start)
echo "Starting $NAME";
$SSD_BIN $SSD_GENERAL_OPTS --chuid ${SRV_UID}:${SRV_GID} --user $SRV_UID \
--group $SRV_GID --start --background --exec $SCREEN
;;
stop)
echo "Pour stopper SteamCast, killer les processus avec pkill steamcast puis kill -9 PID_STEAMCAST";
;;
*)
echo "Usage: {start|stop}" >&2
exit 1
;;
esac
Code: Select all
server:/home/user# more /usr/local/bin/screen
#!/bin/bash
cd /steamcast ; /usr/bin/screen -d -m ./steamcast steamcast.conf > /dev/null