Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[RC-SCRIPT] /etc/init.d/hplip joue des mauvais tours(résolu)
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
billiob
Guru
Guru


Joined: 30 Dec 2004
Posts: 424
Location: Dijon, France

PostPosted: Sun Dec 11, 2005 2:09 pm    Post subject: [RC-SCRIPT] /etc/init.d/hplip joue des mauvais tours(résolu Reply with quote

Salut.
J'ai fait l'acquisition d'une imprimante multi-fonctions HP PSC 2355 qui fonctionne presque parfaitement. Ils ont fait un travail superbe pour linux.
Le seul problème vient d'un script init.
voilà le script en question :
Code:
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/net-print/hplip/files/hplip.init.d,v 1.1 2005/06/07 17:02:33 lanius Exp $

depend() {
        before cupsd
        after hotplug
        use net
}

start() {
        ebegin "Starting hpiod"
        start-stop-daemon --start --quiet --exec /usr/sbin/hpiod
        eend $?

        ebegin "Starting hpssd"
        start-stop-daemon --quiet --start --exec /usr/share/hplip/hpssd.py \
                --pidfile /var/run/hpssd.pid >/dev/null 2>&1
        eend $?
}

stop() {
        ebegin "Stopping hpiod"
        start-stop-daemon --stop --quiet -n hpiod
        eend $?

        ebegin "Stopping hpssd"
        start-stop-daemon --stop --pidfile /var/run/hpssd.pid
        RETVAL=$?
        for PIDFILE in /var/run/*; do
                case "$( basename $PIDFILE )" in
                        hpguid-*.pid)
                                read PID < $PIDFILE
                                kill $PID
                                rm $PIDFILE
                esac
        done
        eend $RETVAL
}

Quand je le lance j'ai un beau :
Code:
# /etc/init.d/hplip start
 * Starting service hplip                                                                                                                                                   [ !! ]
 * FAILED to start service hplip!

J'ai fait des modifs, et je n'arrive pas à le faire fonctionner.
Si je tapes dans la console :
Code:
start-stop-daemon --start --quiet --exec /usr/sbin/hpiod && start-stop-daemon --quiet --start --exec /usr/share/hplip/hpssd.py --pidfile /var/run/hpssd.pid >/dev/null 2>&1
ça marche bien !
Code:
# ps ax
17135 ?        Ssl    0:00 /usr/sbin/hpiod
17144 ?        S      0:00 python /usr/share/hplip/hpssd.py

Alors qu'avec le script en haut, rien n'est lancé.
J'ai cherché sur le forum de http://hpinkjet.sourceforge.net/, le bugzilla, google, j'ai l'impression d'être le seul à avoir ce problème !
_________________
billiob


Last edited by billiob on Tue Dec 13, 2005 4:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
billiob
Guru
Guru


Joined: 30 Dec 2004
Posts: 424
Location: Dijon, France

PostPosted: Sun Dec 11, 2005 5:54 pm    Post subject: Reply with quote

J'ai modifié le script avec ça :
Code:
start() {
        ebegin "Starting hpiod"
        /usr/sbin/hpiod
        eend $?

        ebegin "Starting hpssd"
        /usr/bin/python /usr/share/hplip/hpssd.py
        eend $?
}

stop() {
        ebegin "Stopping hpiod"
        killall hpiod
        eend $?

        ebegin "Stopping hpssd"
        #c'est très moche, mais ça marche:
        kill `ps aux |grep /usr/share/hplip/hpssd.py |head -n 1 |cut -b 10-14`
        RETVAL=$?
        for PIDFILE in /var/run/*; do
                case "$( basename $PIDFILE )" in
                        hpguid-*.pid)
                                read PID < $PIDFILE
                                kill $PID
                                rm $PIDFILE
                esac
        done
        eend $RETVAL
}


J'aurais bien utilisé $!, mais il ne me fournit pas de pid si je le mets après /usr/bin/python /usr/share/hplip/hpssd.py

Bref, le problème est masqué, mais toujours pas résolu.
_________________
billiob
Back to top
View user's profile Send private message
letchideslandes
Apprentice
Apprentice


Joined: 21 Nov 2004
Posts: 178
Location: Landes France

PostPosted: Sun Dec 11, 2005 9:12 pm    Post subject: Reply with quote

J'utilisais hpijs, et suis passé à hplip, et j'ai le même soucis. Mais bon bon, j'ai pas besoin du daemon pour pouvoir imprimer donc je n'y ai pas consacrer de temps.
Back to top
View user's profile Send private message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3504
Location: Alsace (France)

PostPosted: Mon Dec 12, 2005 8:24 am    Post subject: Reply with quote

Code:
start() {
       ebegin "Starting hpiod"
       start-stop-daemon --start --quiet --exec /usr/sbin/hpiod
       local_exit_status=$?
       eend local_exit_status

        ebegin "Starting hpssd"
        [ local_exit_status ] && start-stop-daemon --quiet --start --exec /usr/share/hplip/hpssd.py \
                --pidfile /var/run/hpssd.pid >/dev/null 2>&1
        eend $?
}


ça devrait revenir au même que lorsque tu le lance en ligne de commande, non?
_________________
le "lol" est aux boulets ce que le ";" est au programmeurs
Back to top
View user's profile Send private message
billiob
Guru
Guru


Joined: 30 Dec 2004
Posts: 424
Location: Dijon, France

PostPosted: Mon Dec 12, 2005 8:10 pm    Post subject: Reply with quote

Code:
start() {
        ebegin "Starting hpiod"
        /usr/sbin/hpiod
        local_exit_status=$?
        eend $local_exit_status

        ebegin "Starting hpssd"
        [ $local_exit_status ] && start-stop-daemon --quiet --start --exec /usr/share/hplip/hpssd.py \
                 --pidfile /var/run/hpssd.pid >/dev/null 2>&1
        eend $?
}

stop() {
        ebegin "Stopping hpiod"
        killall hpiod
        eend $?

        ebegin "Stopping hpssd"
        start-stop-daemon --stop --pidfile /var/run/hpssd.pid n
        RETVAL=$?
        for PIDFILE in /var/run/*; do
                case "$( basename $PIDFILE )" in
                        hpguid-*.pid)
                                read PID < $PIDFILE
                                kill $PID
                                rm $PIDFILE
                esac
        done
        eend $RETVAL
}

ceci marche mieux, mais j'ai toujours le problème avec hpiod.
Sans les $ à local_exit_status, j'ai
Code:
can't lock /var/run/hpiod.pid, running daemon's pid may be 16790: io/hpiod/hpiod.cpp 211                                                                                        [ !! ]
/sbin/functions.sh: line 347: return: local_exit_status: numeric argument required
/sbin/functions.sh: line 362: return: local_exit_status: numeric argument required

_________________
billiob
Back to top
View user's profile Send private message
letchideslandes
Apprentice
Apprentice


Joined: 21 Nov 2004
Posts: 178
Location: Landes France

PostPosted: Mon Dec 12, 2005 8:54 pm    Post subject: Reply with quote

Bon je viens de trouver solution à mon problème :
Il suffit d'éditer
Code:
nano -w /usr/share/hplip/hpssd.py


et de remplacer

Quote:
#!/usr/bin/env python


par

Quote:
#!/usr/bin/python


et c'est parti, j'ai maintenant accès à l'allignement des cartouches, le niveau d'encre ...
Merci HP (pour cette fois là)
Back to top
View user's profile Send private message
fb99
l33t
l33t


Joined: 09 Apr 2003
Posts: 990
Location: Le Locle (Suisse,Neuchâtel)

PostPosted: Mon Dec 12, 2005 9:22 pm    Post subject: Reply with quote

merci letchideslandes bien joué; j'avais aussi ce problème mais la flemme de chercher encore merci c'est plus mieux bien comme ça :wink:
_________________
L'ami aime en tout temps, et dans le malheur il se montre un frère ( Prov. 17,17 )
L'insensé même, quand il se tait, passe pour sage ( Prov. 17;28a )
Back to top
View user's profile Send private message
billiob
Guru
Guru


Joined: 30 Dec 2004
Posts: 424
Location: Dijon, France

PostPosted: Tue Dec 13, 2005 4:51 pm    Post subject: Reply with quote

Merci, cela résoud effectivement mon problème.
_________________
billiob
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum