icecast2 daemon disabled - read /etc/default/icecast2

Bonsoir à tous,

Voilà encore une autre erreur que j’ai en voulant démarrer icecast2, je suis allé dans /etc/default/icecast2, j’ai modifié et commuté le flag dans ce fichier et rien ne résous mon problème. Et l’erreur de daemon, c’est la première fois que je l’ai de ma vie, je n’ai jamais eu ce problème quand j’étais sous ubuntu, j’aimerai donc savoir si vous avez une explication PRECISE de ce qu’il faut faire :slightly_smiling:

Merci pour vos futurs réponses :slightly_smiling:

essaie ça:
( en root )

ensuite tu retentes de lancer icecast2.

pour qu’il soit lancé définitivement au démarrage:
(en root)

Ca me remet

Quand je fais l’update, ça me met

Peut-être les fichiers qui sont mal paramétré ?

J’ai réinstallé icecast2 pour reprendre tout depuis le départ et ta manipulation ne fonctionne toujours pas (mais quand je fais tab, il affiche bien la suite, logique). Donc je vous met le fichier /etc/default/icecast2 et dites-moi ce que je dois changer.

[code]# 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=false[/code]

(J’ai déjà essayé avec ENABLE=true, l’utilisateur et le groupe existent). J’ai modifié /etc/icecast2/icecast.xml correctement (j’avais déjà fait les mêmes modifications sous Ubuntu et c’était correct).

Quand je veux démarrer icecast2, il me met précisément cela :

: command not foundt2: line 4: : command not foundt2: line 8: : command not foundt2: line 11: : command not foundt2: line 15: : command not foundt2: line 19: icecast2 daemon disabled - read /etc/default/icecast2.

donne nous le script /etc/init.d/icecast2

Le voici :

[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]
D’après ce que je comprend, si la valeur ENABLE est différente (!=) de TRUE, ça doit afficher le message que j’ai actuellement, mais la valeur est déjà TRUE, j’ai redémarré le serveur mais rien n’y fait :confused:

en fait il n’a pas l’air content des espaces dans /etc/default/icecast2

Remplace-le par

# 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

En fait, à chaque erreur qu’il indique, c’est une ligne vide.

tu fais bien un
/etc/init.d/icecast2 start
?
ou
/usr/bin/icecast2
?

Merci pour la correction Lou ^^ Mais ça m’indique toujours une erreur à la ligne 14 (donc ENABLE=true), j’ai essayé de mettre des guillemets à true, rien n’y fait ^^ Et ça met toujours icecast2 daemon disabled […]

Je fais /etc/init.d/icecast2 start :astonished:

trouvé!

[code]

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[/code]
Tu vois la ligne ENABLE=“false”?
Et bah Lorsque ENABLE est différent de true, il renvoie exactement ton message d’erreur.
met ENABLE à true.

EDIT: on parle bien de /etc/init.d/icecast2 , hein?

sauf qu’on parle pas du même fichier -_-

Donc je dois mettre

[code]# Defaults
CONFIGFILE="/etc/icecast2/icecast.xml"
CONFIGDEFAULTFILE="/etc/default/icecast2"
USERID=icecast2
GROUPID=icecast
ENABLE=“true”

Reads config file (will override defaults above)

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

if [ “$ENABLE” != “true” ]; then
echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
exit 0
fi[/code]
D’après toi ?
Mais j’avais compris que si ENABLE était différent de true (en php != c’est pareil), ça mettait mon erreur ^^

Dans mon fichier /etc/default/icecast2 j’ai true à ENABLE ^^

Edit : Ca y est, j’ai mis true dans le fichier et maintenant quand j’essaie de le démarrer ça me met…

-bash: /etc/init.d/icecast2: /bin/sh^M: bad interpreter: Aucun fichier ou répertoire de ce type

efface l’espace vide après le /bin/sh
#! /bin/sh
(ou remplace par /bin/bash )

[quote=“dchost99”]efface l’espace vide après le /bin/sh
#! /bin/sh
(ou remplace par /bin/bash )[/quote]

En fait, efface l’espace vide avant et après.
en gros:

#! /bin/sh
devient
#!/bin/sh
ou
#!/bin/bash

EDIT: bon, je viens de regarder un peu plus attentivement le script, et en fait effectivement il a du mal à comprendre le “true” contenu dans defaults.
Es-tu dans la branche stable? Si oui, c’est étonnant qu’il y ait ce genre d’erreurs dans ce script.

Ca ne fonctionne toujours pas, il remet la même erreur et quand je met /bin/bash, ça change juste le sh en bash (donc c’est pareil), le problème vient bien de là alors :confused:

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.