Toon posts:

Icecast stopt door cron-job updaten afspeellijst

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik heb icecast draaien als radiostation. Nou heb ik een simpel scriptje gemaakt wat dagelijks mijn mp3-tjes opzoekt en in een playlist-file zet:

code:
1
2
3
#!/bin/sh
locate *.mp3 | grep /data/mp3 > /usr/local/etc/playlist
/etc/rc.d/rc.icecast restart


Dit script wordt dmv een cronjob iedere nacht uitgevoerd. Als ik dit vanaf de commandline uitvoer, gaat alles goed, playlist wordt geupdate en icecast herstart om de nieuwe playlist te lezen. Maar wordt het vanuit de cronjob gedaan, dan wordt de playlist geupdate maar icecast stopt alleen en start daarna niet meer. In de logs is alleen "ices exiting" te vinden wat wel duidt op netjes afsluiten, maar niks over (poging tot) starten.

Nog even het /etc/rc.d/rc.icecast-script:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

icecast_start() {
    echo "Starting icecast:  icecast -b -c /usr/local/etc/icecast.xml"
    icecast -b -c /usr/local/etc/icecast.xml
    
    echo "Starting ices:  ices -c /usr/local/etc/ices.conf -F /usr/local/etc/playlist"
    ices -c /usr/local/etc/ices.conf -F /usr/local/etc/playlist
}

icecast_stop() {
  echo "Stopping ices..."
  kill -INT `cat /var/log/icecast/ices.pid`
  echo "Stopping icecast..."
  kill -INT `cat /usr/local/var/run/icecast/icecast.pid`
}

icecast_restart() {
  icecast_stop
  sleep 2
  icecast_start
}

case "$1" in
'start')
  icecast_start
  ;;
'stop')
  icecast_stop
  ;;
'restart')
  icecast_restart
  ;;
*)
  echo "Que!?"
  ;;
esac

Verwijderd

Topicstarter
er stonden geen paden naar de executables icecast en ices in het rc.icecast-script. Toegevoegd en 't werkt als een zonnetje 8)7

[ Voor 4% gewijzigd door Verwijderd op 29-03-2005 23:11 ]


  • sjokki
  • Registratie: Juli 2002
  • Niet online
Icecast en ices zijn twee verschillende programma's. Je kan ices herstarten terwijl icecast gewoon door loopt. Maar het is niet eens nodig om ices te herstarten omdat ices zelf de playlist opnieuw leest als die veranderd is. Dus het enige wat je hoeft te doen is die playlist veranderen.