I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints? Pieter Botha -- Public PGP key can be obtained from : hkp:/wwwkeys.eu.pgp.net by searching for : bothapn@lantic.net
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
Pieter Botha
You can launch your program from /etc/rc.d/boot.local (this is meant for such things) :-) And in case I understand you right that it ALSO happens when you start X you also need to put it into the X startup file (like .xinitrc or so), but I don't know exactly which one to use for that :-( Yours Martin
Martin Deppe wrote:
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
Pieter Botha
You can launch your program from /etc/rc.d/boot.local (this is meant for such things) :-)
And in case I understand you right that it ALSO happens when you start X you also need to put it into the X startup file (like .xinitrc or so), but I don't know exactly which one to use for that :-(
Or use ~/.kde/Autostart.
The thing is that as soon as I get a display (run level 5 is entered), one of the relays are opened. I have set the script to run on all run levels thus it does run on runlevel 5, it just runs before something else. What could the "something else" be? Where can I see in what order stuff are started for runlevel 5? Thanks. Pieter Botha On Wednesday 19 January 2005 13:56, Martin Deppe wrote:
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
Pieter Botha
You can launch your program from /etc/rc.d/boot.local (this is meant for such things) :-)
And in case I understand you right that it ALSO happens when you start X you also need to put it into the X startup file (like .xinitrc or so), but I don't know exactly which one to use for that :-(
Yours Martin
-- Public PGP key can be obtained from : hkp:/wwwkeys.eu.pgp.net by searching for : bothapn@lantic.net
At 07:22 PM 20/01/2005, Pieter Botha wrote:
The thing is that as soon as I get a display (run level 5 is entered), one of the relays are opened. I have set the script to run on all run levels thus it does run on runlevel 5, it just runs before something else. What could the "something else" be? Where can I see in what order stuff are started for runlevel 5?
I may be off line but: I suspect the port is being "poled" to see if anything is on it by linux and your device (relay) is somehow connected to one of the two control pins instead of just a data port (such as use to be done back when the standard parallel device was the motorolla 6820/1/2) to gain extra device connections without using multipliers. The easiest fix is, if you have a spare still change the relay connection to another, otherwise you need to do some reprogramming to stop the test, and that won't be easy. regards scsijon
Thanks. Pieter Botha
On Wednesday 19 January 2005 13:56, Martin Deppe wrote:
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
Pieter Botha
You can launch your program from /etc/rc.d/boot.local (this is meant for such things) :-)
And in case I understand you right that it ALSO happens when you start X you also need to put it into the X startup file (like .xinitrc or so), but I don't know exactly which one to use for that :-(
Yours Martin
-- Public PGP key can be obtained from : hkp:/wwwkeys.eu.pgp.net by searching for : bothapn@lantic.net
Jon, Pieter, On Thursday 20 January 2005 01:09, scsijon wrote:
At 07:22 PM 20/01/2005, Pieter Botha wrote:
The thing is that as soon as I get a display (run level 5 is entered), one of the relays are opened. I have set the script to run on all run levels thus it does run on runlevel 5, it just runs before something else. What could the "something else" be? Where can I see in what order stuff are started for runlevel 5?
I may be off line but:
I suspect the port is being "poled" to see if anything is on it by linux and your device (relay) is somehow connected to one of the two control pins instead of just a data port (such as use to be done back when the standard parallel device was the motorolla 6820/1/2) to gain extra device connections without using multipliers.
The most obvious hunch for stock system software that's accessing the printer port is the printing subsym. On my system run levels 2, 3 and 5 start CUPS. Levels 1, 2, 3 and 5 start the hot-plug software. Either or both of these could be causing unwanted interference, but given that the unwanted external device activation occurs only when entering run level 5, the hot-plug software is probably excluded from consideration.
The easiest fix is, if you have a spare still change the relay connection to another, otherwise you need to do some reprogramming to stop the test, and that won't be easy.
By "spare" do you mean a spare parallel port? If so, the interfering software may be accessing all available printer ports. I'd say the easiest diagnostic test is to disable CUPS for run level 5 temporarily to see if the symptom is alleviated. If it is, then fix the CUPS configuration so it does not include the parallel port used by the remote irrigation control system.
regards scsijon
Randall Schulz
At 03:01 AM 21/01/2005, Randall R Schulz wrote:
Jon, Pieter,
On Thursday 20 January 2005 01:09, scsijon wrote:
At 07:22 PM 20/01/2005, Pieter Botha wrote:
The thing is that as soon as I get a display (run level 5 is entered), one of the relays are opened. I have set the script to run on all run levels thus it does run on runlevel 5, it just runs before something else. What could the "something else" be? Where can I see in what order stuff are started for runlevel 5?
I may be off line but:
I suspect the port is being "poled" to see if anything is on it by linux and your device (relay) is somehow connected to one of the two control pins instead of just a data port (such as use to be done back when the standard parallel device was the motorolla 6820/1/2) to gain extra device connections without using multipliers.
The most obvious hunch for stock system software that's accessing the printer port is the printing subsym.
On my system run levels 2, 3 and 5 start CUPS. Levels 1, 2, 3 and 5 start the hot-plug software. Either or both of these could be causing unwanted interference, but given that the unwanted external device activation occurs only when entering run level 5, the hot-plug software is probably excluded from consideration.
The easiest fix is, if you have a spare still change the relay connection to another, otherwise you need to do some reprogramming to stop the test, and that won't be easy.
By "spare" do you mean a spare parallel port? If so, the interfering software may be accessing all available printer ports.
no spare connection for an external device on that particular printer port. usually connections (using the 6820 model) go to PA0-PA7 and PB0 to PB7 (the two sets of 8 bit data i/o connections) via a analog buffer. The extra ones are the two controls (PAA, PAB, PBA, PBB) associated with each of them and can be used for controlling things like running the buffer bidirectional as a printer port is usually configured for on one side or accepting the input after a predetermined time. However the ports, if only being used one way (output or input), have the associated controls unused, this is when they can be reused.
I'd say the easiest diagnostic test is to disable CUPS for run level 5 temporarily to see if the symptom is alleviated. If it is, then fix the CUPS configuration so it does not include the parallel port used by the remote irrigation control system.
regards scsijon
Randall Schulz
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
Pieter Botha wrote:
The thing is that as soon as I get a display (run level 5 is entered), one of the relays are opened. I have set the script to run on all run levels thus it does run on runlevel 5, it just runs before something else. What could the "something else" be? Where can I see in what order stuff are started for runlevel 5?
/etc/init.d/rc.5 If you made a startup script, you could add kdm to the required to start line, which would make it start after X is up and kdm login manager has started. -- Joe Morris New Tribes Mission Email Address: Joe_Morris@ntm.org Registered Linux user 231871
The Thursday 2005-01-20 at 10:22 +0200, Pieter Botha wrote:
The thing is that as soon as I get a display (run level 5 is entered), one of the relays are opened. I have set the script to run on all run levels thus it does run on runlevel 5, it just runs before something else. What could the "something else" be? Where can I see in what order stuff are started for runlevel 5?
read: SUSE LINUX Administration Guide Chapter 12. The SUSE LINUX Boot Concept Short explanation: the order of execution of runlevel 5 scripts is determined by the numerals of the links in "/etc/init.d/rc5.d/S*". For example, S18cron will execute before S21splash_late and after S17apache2. See it? -- Cheers, Carlos Robinson
On Fri, 2005-01-21 at 21:22, Carlos E. R. wrote:
The Thursday 2005-01-20 at 10:22 +0200, Pieter Botha wrote:
The thing is that as soon as I get a display (run level 5 is entered), one of the relays are opened. I have set the script to run on all run levels thus it does run on runlevel 5, it just runs before something else. What could the "something else" be? Where can I see in what order stuff are started for runlevel 5?
read: SUSE LINUX Administration Guide Chapter 12. The SUSE LINUX Boot Concept
Short explanation: the order of execution of runlevel 5 scripts is determined by the numerals of the links in "/etc/init.d/rc5.d/S*". For example, S18cron will execute before S21splash_late and after S17apache2. See it?
-- Cheers, Carlos Robinson
The newer init scripts also incorporate the following (portmap example): # System startup script for the RPC program number mapper # ### BEGIN INIT INFO # Provides: portmap # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 4 6 # Description: DARPA port to RPC program number mapper ### END INIT INFO So not only is the the S# used but also the "# Required-Start:" line. In the portmap example the network and syslog init scripts need to be run first. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 * Only reply to the list please* "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
The Saturday 2005-01-22 at 19:54 -0500, Ken Schneider wrote:
Short explanation: the order of execution of runlevel 5 scripts is determined by the numerals of the links in "/etc/init.d/rc5.d/S*". For example, S18cron will execute before S21splash_late and after S17apache2. See it?
The newer init scripts also incorporate the following (portmap example):
# System startup script for the RPC program number mapper # ### BEGIN INIT INFO # Provides: portmap # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 4 6 # Description: DARPA port to RPC program number mapper ### END INIT INFO
So not only is the the S# used but also the "# Required-Start:" line. In the portmap example the network and syslog init scripts need to be run first.
No, that is not so. The "Required-*" tokens are used by innserv or chkconfig scripts (or yast) to create the links with the appropiate numerical order. If you don't believe me, just analyse how the master script "/etc/init.d/rc" works: it calls all the runlevel scripts in the appropiate order. It doesn't check the tokens, that's something else's job. -- Cheers, Carlos Robinson
On Tue, 2005-01-25 at 21:44, Carlos E. R. wrote:
The Saturday 2005-01-22 at 19:54 -0500, Ken Schneider wrote:
Short explanation: the order of execution of runlevel 5 scripts is determined by the numerals of the links in "/etc/init.d/rc5.d/S*". For example, S18cron will execute before S21splash_late and after S17apache2. See it?
The newer init scripts also incorporate the following (portmap example):
# System startup script for the RPC program number mapper # ### BEGIN INIT INFO # Provides: portmap # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 4 6 # Description: DARPA port to RPC program number mapper ### END INIT INFO
So not only is the the S# used but also the "# Required-Start:" line. In the portmap example the network and syslog init scripts need to be run first.
No, that is not so. The "Required-*" tokens are used by innserv or chkconfig scripts (or yast) to create the links with the appropiate numerical order. If you don't believe me, just analyse how the master script "/etc/init.d/rc" works: it calls all the runlevel scripts in the appropiate order. It doesn't check the tokens, that's something else's job.
-- Cheers, Carlos Robinson
I sit corrected. Who says you can't teach an old dog new tricks. :-) -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 * Only reply to the list please* "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
/etc/init.d/skeleton as a base, and make a startup script which you can choose when you want it to start, i.e. runlevel 5 (X), etc. Also check the admin manual. -- Joe Morris New Tribes Mission Email Address: Joe_Morris@ntm.org Registered Linux user 231871
Joe Morris (NTM) wrote:
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
/etc/init.d/skeleton as a base, and make a startup script which you can choose when you want it to start, i.e. runlevel 5 (X), etc. Also check the admin manual.
Why use skelton? That means that all users created after that, would run that app. It can be started from /etc/init.d/boot.local or ~/.kde/Autostart.
James Knott wrote:
Joe Morris (NTM) wrote:
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
/etc/init.d/skeleton as a base, and make a startup script which you can choose when you want it to start, i.e. runlevel 5 (X), etc. Also check the admin manual.
Why use skelton? That means that all users created after that, would run that app. It can be started from /etc/init.d/boot.local or ~/.kde/Autostart. It looks to me like he has created a program to control his garden. I would assume that would run /be needed regardless of which user is logged in. /etc/init.d/boot.local executes before most other scripts, meaning if he needed some other program/process running for his to work, it may not work starting so early in the boot process. If he sometimes started in runlevel 3 he could also have his program run. If he only needed it to run whenever he logged in, in only his user, ~/.kde/Autostart would be fine. I just suspect his garden needed more control than that. ;-) If my logic didn't fit his need, he is quite welcome to hit the delete key and try the next. He was asking for hints. -- Joe Morris New Tribes Mission Email Address: Joe_Morris@ntm.org Registered Linux user 231871
Joe Morris (NTM) wrote:
James Knott wrote:
Joe Morris (NTM) wrote:
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
/etc/init.d/skeleton as a base, and make a startup script which you can choose when you want it to start, i.e. runlevel 5 (X), etc. Also check the admin manual.
Why use skelton? That means that all users created after that, would run that app. It can be started from /etc/init.d/boot.local or ~/.kde/Autostart.
It looks to me like he has created a program to control his garden. I would assume that would run /be needed regardless of which user is logged in. /etc/init.d/boot.local executes before most other scripts, meaning if he needed some other program/process running for his to work, it may not work starting so early in the boot process. If he sometimes started in runlevel 3 he could also have his program run. If he only needed it to run whenever he logged in, in only his user, ~/.kde/Autostart would be fine. I just suspect his garden needed more control than that. ;-) If my logic didn't fit his need, he is quite welcome to hit the delete key and try the next. He was asking for hints.
<lol> great :-D
Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
For the desktop, place a link to the app in ~/.kde/Autostart. To run when the computer boots, start it from /etc/init.d/boot.local.
Pieter, On Wednesday 19 January 2005 03:47, Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
You might want to clarify if you're talking about X as in the "X Window System" (the graphical user interface subsystem used in most Unix systems) or X as in the X10 the home remote control interface system. People here are likely to assume X means the windowing system, since it's ubiquitous while the X10 remote control system is probably used by only a few users.
Pieter Botha
Randall Schulz
The Wednesday 2005-01-19 at 13:47 +0200, Pieter Botha wrote:
I need to run a program which resets my LPT port on startup (LPT is connected to garden system and if any of the relays are open, then some stuff in the garden are turned on). I see that as soon as X is started, some relays are opened and I need to run a program to set them back off (closed). The software already works, the trick is to start it as soon as X start as well as when the PC reboots. Any hints?
Make sure the printer daemon is dissabled: nimrodel:~ # chkconfig cups cups 35 in my case, it is set to run in runlevels 3 and 5. As to how to run scripts automatically, have a look at "/etc/init.d/skeleton" don't confuse this with user creation skeleton). -- Cheers, Carlos Robinson
participants (8)
-
Carlos E. R.
-
James Knott
-
Joe Morris (NTM)
-
Ken Schneider
-
Martin Deppe
-
Pieter Botha
-
Randall R Schulz
-
scsijon