Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 115195 - Sync clock on hpoj startup
Summary: Sync clock on hpoj startup
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-11 07:15 UTC by Christopher Covington
Modified: 2006-01-15 11:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Changes to /etc/init.d/hpoj I accidentally said ptal-hp was in sbin. (hpoj-diff,313 bytes, patch)
2005-12-11 07:19 UTC, Christopher Covington
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Covington 2005-12-11 07:15:41 UTC
If one doesn't keep their officejet plugged into a constantly-on power source (I
for one have it plugged into a power strip that I turn off at night), the clock
always wants to be set. Setting the clock is really easy. I'm including the
patch to /etc/init.d/hpoj that will sync the printer's clock to the computer's.
Comment 1 Christopher Covington 2005-12-11 07:19:03 UTC
Created attachment 74501 [details, diff]
Changes to /etc/init.d/hpoj
I accidentally said ptal-hp was in sbin.
Comment 2 Marcelo Goes (RETIRED) gentoo-dev 2005-12-11 08:34:03 UTC
A question: what happens if the printer is turned off when you run this script?
Comment 3 Christopher Covington 2005-12-11 09:08:09 UTC
Comment on attachment 74501 [details, diff]
Changes to /etc/init.d/hpoj
I accidentally said ptal-hp was in sbin.

>--- /etc/init.d/hpoj.original   2005-12-11 10:09:02.071603500 -0500
>+++ /etc/init.d/hpoj    2005-12-11 10:08:46.642639250 -0500
>@@ -7,6 +7,8 @@
> start() {
>        ebegin Starting hpoj
>        /usr/bin/ptal-init start -q
>+       einfo Syncing printer clock
>+       /usr/sbin/ptal-hp clock -set
>        eend 0
> }
>
Comment 4 Christopher Covington 2005-12-11 14:39:22 UTC
ptal-mlcd: ERROR at ExMgr.cpp:2525, dev=<mlc:par:OfficeJet-700>, pid=16877,
e=11, t=1134340272
Couldn't find device!

ptal-mlcd: ERROR at ExMgr.cpp:2525, dev=<mlc:par:OfficeJet-700>, pid=16877,
e=11, t=1134340274
Couldn't find device!
/usr/bin/ptal-hp: Unable to communicate with device "mlc:par:OfficeJet-700"!

Syntax: /usr/bin/ptal-hp [<devname>] <command> [-help] [<params>...]
Where <devname> may be one of:
        mlc:par:OfficeJet-700
Valid commands:
        device
        display
        clock 

That's what happens when you try to do this when the printer is off. I tried
adding &> /dev/null || ewarn "Printer looks powered off" to the end of the clock
line but that doesn't keep the mlcd errors off of the console. I suppose I spoke
too soon, saying it's "really easy."
Comment 5 Stefan Schweizer (RETIRED) gentoo-dev 2006-01-14 16:40:41 UTC
2>&1 >/dev/null use that and see if it works for you please
Comment 6 Christopher Covington 2006-01-15 11:24:38 UTC
Squelching it like that doesn't do the trick either. ptal-mlcd seems to be the information-dumping culprit, not ptal-hp. I'd investigate where that gets called and squelch or log it, but hpoj is deprecated and I'll only be using it until I get the newer hp drivers working.