| View previous topic :: View next topic |
| Author |
Message |
billiob Guru


Joined: 30 Dec 2004 Posts: 424 Location: Dijon, France
|
Posted: Sun Dec 11, 2005 2:09 pm Post subject: [RC-SCRIPT] /etc/init.d/hplip joue des mauvais tours(résolu |
|
|
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 |
|
 |
billiob Guru


Joined: 30 Dec 2004 Posts: 424 Location: Dijon, France
|
Posted: Sun Dec 11, 2005 5:54 pm Post subject: |
|
|
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 |
|
 |
letchideslandes Apprentice


Joined: 21 Nov 2004 Posts: 178 Location: Landes France
|
Posted: Sun Dec 11, 2005 9:12 pm Post subject: |
|
|
| 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 |
|
 |
Enlight Advocate


Joined: 28 Oct 2004 Posts: 3504 Location: Alsace (France)
|
Posted: Mon Dec 12, 2005 8:24 am Post subject: |
|
|
| 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 |
|
 |
billiob Guru


Joined: 30 Dec 2004 Posts: 424 Location: Dijon, France
|
Posted: Mon Dec 12, 2005 8:10 pm Post subject: |
|
|
| 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 |
|
 |
letchideslandes Apprentice


Joined: 21 Nov 2004 Posts: 178 Location: Landes France
|
Posted: Mon Dec 12, 2005 8:54 pm Post subject: |
|
|
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
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 |
|
 |
fb99 l33t


Joined: 09 Apr 2003 Posts: 990 Location: Le Locle (Suisse,Neuchâtel)
|
Posted: Mon Dec 12, 2005 9:22 pm Post subject: |
|
|
merci letchideslandes bien joué; j'avais aussi ce problème mais la flemme de chercher encore merci c'est plus mieux bien comme ça  _________________ 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 |
|
 |
billiob Guru


Joined: 30 Dec 2004 Posts: 424 Location: Dijon, France
|
Posted: Tue Dec 13, 2005 4:51 pm Post subject: |
|
|
Merci, cela résoud effectivement mon problème. _________________ billiob |
|
| Back to top |
|
 |
|