icecast2 daemon disabled - read /etc/default/icecast2

Bon, je ne garantis rien, mais voila quelques tests que tu peux effectuer en console:
Renvoie-nous les résultats de:

which sh # pour savoir où se trouve sh
which bash # idem pour bash

Ensuite, essaie de virer la première ligne de /etc/init.d/icecast2
puis en root

sh /etc/init.d/icecast2 # fait la même chose qu'avant, en spécifiant l'interpréteur
# si erreur
bash /etc/init.d/icecast2

Si je fais ta manipulation sans enlever la première ligne, ça me fait ça :

: command not found2: line 20: : command not found2: line 25: : numeric argument required26: exit: 0
Pareil si je l’enlève mais ça devient alors line 19 et 24 :confused:

je remet le code parce que remonter à chaque fois pour vérifier un truc ça me gonfle:

[code]#! /bin/sh

BEGIN INIT INFO

Provides: icecast2

Required-Start: $remote_fs $network

Required-Stop: $remote_fs

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: Starts the icecast audio streaming server daemon

END INIT INFO

icecast2

Written by Miquel van Smoorenburg miquels@cistron.nl.

Modified for Debian

by Ian Murdock imurdock@gnu.ai.mit.edu.

Further modified by Keegan Quinn ice@thebasement.org

for use with Icecast 2

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/icecast2
NAME=icecast2
DESC=icecast2

test -x $DAEMON || exit 0

Defaults

CONFIGFILE="/etc/icecast2/icecast.xml"
CONFIGDEFAULTFILE="/etc/default/icecast2"
USERID=icecast2
GROUPID=icecast
ENABLE=“false”

Reads config file (will override defaults above)

[ -r “$CONFIGDEFAULTFILE” ] && . $CONFIGDEFAULTFILE

if [ “$ENABLE” != “true” ]; then
echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
exit 0
fi

set -e

case “$1” in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID
–exec $DAEMON – -b -c $CONFIGFILE
echo “$NAME.”
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
echo “$NAME.”
;;
reload|force-reload)
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID
–exec $DAEMON – -b -c $CONFIGFILE
echo “$NAME.”
;;
*)
echo “Usage: $0 {start|stop|restart|reload|force-reload}” >&2
exit 1
;;
esac

exit 0[/code]

et si tu essayais avec un seul pipe (|) ?
quelle erreur renvoie-t-il ?
les retours chariot intenpestifs ne gênent pas pour l’instant, ce ne sont que des avertissements, mais bon…

Ca me met :

: command not found2: line 19: : command not found2: line 24: : numeric argument required25: exit: 0 : command not found2: line 26: : command not found2: line 33: : command not found2: line 36: 'etc/init.d/icecast2: line 44: syntax error near unexpected token `in 'etc/init.d/icecast2: line 44: `case "$1" in

J’image que c’est pas mieux que tout à l’heure :stuck_out_tongue:

bon bon bon…
je reviens de ma belle console avec quelques nouvelles infos.

j’ai installé icecast2.

j’ai essayé sudo /etc/init.d/icecast2 start
read config file blah blah blah…
j’ai mis ENABLE à true dans /etc/default/icecast2
j’ai retenté… et ça a fonctionné.

j’en conclus que ça fonctionne.

Je te redonne les originaux au cas où…

/etc/init.d/icecast2

#! /bin/sh                                                        
### BEGIN INIT INFO                                               
# Provides:          icecast2                                     
# Required-Start:    $remote_fs $network                          
# Required-Stop:     $remote_fs                                   
# Default-Start:     2 3 4 5                                      
# Default-Stop:      0 1 6                                        
# Short-Description: Starts the icecast audio streaming server daemon
### END INIT INFO                                                    
#                                                                    
# icecast2                                                           
#                                                                    
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#               Modified for Debian                                    
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.              
#                                                                      
#               Further modified by Keegan Quinn <ice@thebasement.org> 
#               for use with Icecast 2                                 
#                                                                      

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/icecast2                                         
NAME=icecast2                                                    
DESC=icecast2

test -x $DAEMON || exit 0

# Defaults
CONFIGFILE="/etc/icecast2/icecast.xml"
CONFIGDEFAULTFILE="/etc/default/icecast2"
USERID=icecast2
GROUPID=icecast
ENABLE="false"

# Reads config file (will override defaults above)
[ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE

if [ "$ENABLE" != "true" ]; then
        echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
        exit 0
fi

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
                --exec $DAEMON -- -b -c $CONFIGFILE
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
        echo "$NAME."
        ;;
  reload|force-reload)
        echo "Reloading $DESC configuration files."
        start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
        ;;
  restart)
        echo -n "Restarting $DESC: "
        # Send TERM after 5 seconds, wait at most 30 seconds.
        start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --exec $DAEMON
        start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
                --exec $DAEMON -- -b -c $CONFIGFILE
        echo "$NAME."
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

/etc/default/icecast2:

# Defaults for icecast2 initscript
# sourced by /etc/init.d/icecast2
# installed at /etc/default/icecast2 by the maintainer scripts

#
# This is a POSIX shell fragment
#

# Full path to the server configuration file
CONFIGFILE="/etc/icecast2/icecast.xml"

# Name or ID of the user and group the daemon should run under
USERID=icecast2
GROUPID=icecast

# Edit /etc/icecast2/icecast.xml and change at least the passwords.
# Change this to true when done to enable the init.d script
ENABLE=true

/etc/icecast2/icecast.xml

<icecast>                                                                  
    <limits>                                                               
        <clients>100</clients>                                             
        <sources>2</sources>                                               
        <threadpool>5</threadpool>                                         
        <queue-size>524288</queue-size>                                    
        <client-timeout>30</client-timeout>                                
        <header-timeout>15</header-timeout>                                
        <source-timeout>10</source-timeout>                                
        <!-- If enabled, this will provide a burst of data when a client   
             first connects, thereby significantly reducing the startup    
             time for listeners that do substantial buffering. However,    
             it also significantly increases latency between the source    
             client and listening client.  For low-latency setups, you     
             might want to disable this. -->                               
        <burst-on-connect>1</burst-on-connect>                             
        <!-- same as burst-on-connect, but this allows for being more      
             specific on how much to burst. Most people won't need to      
             change from the default 64k. Applies to all mountpoints  -->  
        <burst-size>65535</burst-size>                                     
    </limits>                                                              

    <authentication>
        <!-- Sources log in with username 'source' -->
        <source-password>hackme</source-password>     
        <!-- Relays log in username 'relay' -->       
        <relay-password>hackme</relay-password>       

        <!-- Admin logs in with the username given below -->
        <admin-user>admin</admin-user>                      
        <admin-password>hackme</admin-password>             
    </authentication>                                       

    <!-- set the mountpoint for a shoutcast source to use, the default if not
         specified is /stream but you can change it here if an alternative is
         wanted or an extension is required                                  
    <shoutcast-mount>/live.nsv</shoutcast-mount>                             
    -->                                                                      

    <!-- Uncomment this if you want directory listings -->
    <!--                                                  
    <directory>                                           
        <yp-url-timeout>15</yp-url-timeout>               
        <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
    </directory>                                           
     -->                                                   

    <!-- This is the hostname other people will use to connect to your server.
    It affects mainly the urls generated by Icecast for playlists and yp      
    listings. -->                                                             
    <hostname>localhost</hostname>                                            

    <!-- You may have multiple <listener> elements -->
    <listen-socket>                                   
        <port>8000</port>                             
        <!-- <bind-address>127.0.0.1</bind-address> -->
        <!-- <shoutcast-mount>/stream</shoutcast-mount> -->
    </listen-socket>                                       
    <!--                                                   
    <listen-socket>                                        
        <port>8001</port>                                  
    </listen-socket>                                       
    -->                                                    

    <!--<master-server>127.0.0.1</master-server>-->
    <!--<master-server-port>8001</master-server-port>-->
    <!--<master-update-interval>120</master-update-interval>-->
    <!--<master-password>hackme</master-password>-->           

    <!-- setting this makes all relays on-demand unless overridden, this is
         useful for master relays which do not have <relay> definitions here.
         The default is 0 -->                                                
    <!--<relays-on-demand>1</relays-on-demand>-->                            

    <!--
    <relay>
        <server>127.0.0.1</server>
        <port>8001</port>         
        <mount>/example.ogg</mount>
        <local-mount>/different.ogg</local-mount>
        <on-demand>0</on-demand>                 

        <relay-shoutcast-metadata>0</relay-shoutcast-metadata>
    </relay>                                                  
    -->                                                       

    <!-- Only define a <mount> section if you want to use advanced options,
         like alternative usernames or passwords                           
    <mount>                                                                
        <mount-name>/example-complex.ogg</mount-name>                      

        <username>othersource</username>
        <password>hackmemore</password> 

        <max-listeners>1</max-listeners>
        <dump-file>/tmp/dump-example1.ogg</dump-file>
        <burst-size>65536</burst-size>               
        <fallback-mount>/example2.ogg</fallback-mount>
        <fallback-override>1</fallback-override>      
        <fallback-when-full>1</fallback-when-full>    
        <intro>/example_intro.ogg</intro>             
        <hidden>1</hidden>                            
        <no-yp>1</no-yp>                              
        <authentication type="htpasswd">              
                <option name="filename" value="myauth"/>
                <option name="allow_duplicate_users" value="0"/>
        </authentication>                                       
        <on-connect>/home/icecast/bin/stream-start</on-connect> 
        <on-disconnect>/home/icecast/bin/stream-stop</on-disconnect>
    </mount>                                                        

    <mount>
        <mount-name>/auth_example.ogg</mount-name>
        <authentication type="url">               
            <option name="mount_add"       value="http://myauthserver.net/notify_mount.php"/>
            <option name="mount_remove"    value="http://myauthserver.net/notify_mount.php"/>
            <option name="listener_add"    value="http://myauthserver.net/notify_listener.php"/>
            <option name="listener_remove" value="http://myauthserver.net/notify_listener.php"/>
        </authentication>                                                                       
    </mount>                                                                                    

    -->

    <fileserve>1</fileserve>

    <paths>
                <!-- basedir is only used if chroot is enabled -->
        <basedir>/usr/share/icecast2</basedir>

        <!-- Note that if <chroot> is turned on below, these paths must both
             be relative to the new root, not the original root -->
        <logdir>/var/log/icecast2</logdir>
        <webroot>/usr/share/icecast2/web</webroot>
        <adminroot>/usr/share/icecast2/admin</adminroot>
        <!-- <pidfile>/usr/share/icecast2/icecast.pid</pidfile> -->

        <!-- Aliases: treat requests for 'source' path as being for 'dest' path
             May be made specific to a port or bound address using the "port"
             and "bind-address" attributes.
          -->
        <!--
        <alias source="/foo" dest="/bar"/>
          -->
        <!-- Aliases: can also be used for simple redirections as well,
             this example will redirect all requests for http://server:port/ to
             the status page
          -->
        <alias source="/" dest="/status.xsl"/>
    </paths>

    <logging>
        <accesslog>access.log</accesslog>
        <errorlog>error.log</errorlog>
        <!-- <playlistlog>playlist.log</playlistlog> -->
        <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
        <logsize>10000</logsize> <!-- Max size of a logfile -->
        <!-- If logarchive is enabled (1), then when logsize is reached
             the logfile will be moved to [error|access|playlist].log.DATESTAMP,
             otherwise it will be moved to [error|access|playlist].log.old.
             Default is non-archive mode (i.e. overwrite)
        -->
        <!-- <logarchive>1</logarchive> -->
    </logging>

    <security>
        <chroot>0</chroot>
        <!--
        <changeowner>
            <user>nobody</user>
            <group>nogroup</group>
        </changeowner>
        -->
    </security>
</icecast>

Voilou.
Tu ne m’as pas donné les retours de which sh et de which bash … j’en conclus qu’ils étaient ceux attendus?

En tout cas, je ne pense pas que le logiciel soit à remettre en cause, car il a démarré sans problème chez moi.

J’ai mis les mêmes fichiers (que tu as mis) et quand je démarre ça me met maintenant

Normal ? x_x
Pour les which, ça me mettait “/bin/sh” et “bin/bash” ^^

lorsque tu lance quoi? /etc/init.d/icecast2 ?
C’est que tu t’es trompé quelque part.
pour vérifier que tout est bon, teste ces commandes:

cat /etc/init.d/icecast2 cat /etc/default/icecast2 cat /etc/icecast2/icecast2.xml which icecast2 # devrait renvoyer /usr/bin/icecast2 je crois

Si les 3 commandes renvoient le contenu correspondant, c’est louche…

Bon, je vais dormir ( et oui, je suis humain )
mais je suis de retour bientôt ( dans 8h-9h )

Bonne nuit

J’ai le regret de te l’annoncer mais oui, ça renvoi le contenu correctement x_x Et le which renvoi bien /usr/bin/icecast2…

Au passage, c’était icecast.xml et pas icecast2.xml

Pour précision, je suis sous Debian lenny, si ça change quelque chose…
Moi je serai là vers 12 - 13h je pense ! ^^

Bonne nuit à toi, et merci de tes réponses régulières :smiley:

Bon, je n’ai toujours pas résolu mon problème, j’ai cherché sur divers sites et toujours rien :confused:

bon, remplace le /etc/init.d/icecast2
par celui ci-dessous:

#!/bin/sh                                  
echo 'test 1'
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/icecast2                                         
NAME=icecast2                                                    
DESC=icecast2
echo 'test 2'
test -x $DAEMON || exit 0
echo 'test 3'
# Defaults
CONFIGFILE="/etc/icecast2/icecast.xml"
CONFIGDEFAULTFILE="/etc/default/icecast2"
USERID=icecast2
GROUPID=icecast
ENABLE="false"
echo 'test 4'
# Reads config file (will override defaults above)
[ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE
echo 'test 5'
if [ "$ENABLE" != "true" ]; then
        echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
        exit 0
fi
echo 'test 6'
set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
                --exec $DAEMON -- -b -c $CONFIGFILE
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
        echo "$NAME."
        ;;
  reload|force-reload)
        echo "Reloading $DESC configuration files."
        start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
        ;;
  restart)
        echo -n "Restarting $DESC: "
        # Send TERM after 5 seconds, wait at most 30 seconds.
        start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet --exec $DAEMON
        start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
                --exec $DAEMON -- -b -c $CONFIGFILE
        echo "$NAME."
        ;;
  *)
        echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
        exit 1
        ;;
esac
echo 'test 7'
exit 0

et écrit ici TOUT ce qui est renvoyé par par la commande

tu utilise quoi comme éditeur texte?
essaye d’utiliser nano, appartement tu as un éditeur de texte qui ne convient pas.

J’utilise wordpad et il n’a jamais eu un soucis à ce niveau (espacement, etc) ^^ Et quand j’ouvre Adobe Dreamweaver CS4, je lag comme un malade x_x

Quand je modifie /etc/init.d/icecast2 et que je démarre, ça me met :

Comme tout à l’heure quoi…

c’est quoi les accents (espacement, etc) ^^ dans tes post ?

Maintenant c’est une seule ligne et à mon avis tu as fait une seul modif

donc essaye de refaire ta modif mais avec nano (coute rien d’essayer)… (efface les espace vides)

Je vais plutôt effacer icecast2 et le réinstaller en le téléchargeant du site de icecast et pas en faisant apt-get install icecast2 :unamused:
Je vous dis quoi ^^

Edit : Bon j’ai une erreur dans la désinstallation, j’ai voulu le désinstaller via Synaptic sur mon interface graphique et ça me met :
E: icecast2: le sous-processus pre-removal script a retourné une erreur de sortie d’état 127

[quote=“Ashes”]
Je vous dis quoi ^^[/quote]
:mrgreen:
essaye en terminal apt-get remove

E: Impossible de verrouiller /var/lib/dpkg/lock - open (11 Ressource temporairement non disponible) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
:s

redémarre le pc

Après redémarrage, ça n’a plus mis la même erreur (j’avais déjà eu cette erreur et y’a que le redémarrage qui fonctionne ^^) mais commence par désinstaller le tout, puis à la fin il me met quand même :

Suppression de icecast2 ... : Aucun fichier ou répertoire de ce type invoke-rc.d: initscript icecast2, action "stop" failed. dpkg : erreur de traitement de icecast2 (--remove) : le sous-processus pre-removal script a retourné une erreur de sortie d'état 127 Des erreurs ont été rencontrées pendant l'exécution : icecast2 E: Sub-process /usr/bin/dpkg returned an error code (1)

Bon bah je vais arrêter les frais, je suis lasser de “chipoter” avec ça et de vous faire perdre votre temps alors que l’erreur provient de moi. Je vais télécharger l’executable Windows et le lancer sous Wine, ça suffira amplement ^^’

Merci quand même pour vos efforts fournis, si j’ai un problème avec Icecast2 win32 et Wine (avec moi, on sait jamais…), je vous le dirai x)

c’est normal l’erreur
ton script ne marche pas donc il t’informe
tu peux toujours le supprimer manuellement
rm -f /etc/init.d/icecast2
reinstall et ne fait pas de modifs avec wordpad
utilise nano (ou gedit)
ctrl x pour quiter
les flèches pour naviguer …

C’est plus simple avec Wine ^^ Mais j’ai encore un soucis de démarrage, j’ai modifié icecast.xml mais il refuse de démarrer le serveur radio, dois-je redémarrer tout mon serveur pour que les configurations soient pris en compte ?

Edit : Et bien non ! C’est bon ça fonctionne parfaitement ! :smiley: Merci pour votre aide ! ^^