On Tue, 15 Jul 2003, Daniel Teixeira wrote:
>
> The thing is i need the linux to end all the local printing sessions
> before it shuts down... And i dont want these sessions to be active on
> the as400 after the machines power off.
>
> I have createad a shellscrip than when i do "killapp lp5250d" the linux
> deamon is killed but the linux session keeps open....
>

I'm not sure what version of Linux you're using, or how it does things...
A number of years ago, I was running a Linux machine on RedHat 7.1.   I
created an lp5250d.sh script that went into /etc/rc.d/init.d, and then
I had symlinks called K20lp5250d and S20lp5250d going from the
/etc/rc.d/rc0.d and /etc/rc.d/rc3.d /etc/rc.d/rc6.d directories.

The script would start lp5250d when the system started, and kill it
when the system shut down.

Here's what the script looked like:

#!/bin/sh
#   This is used to start the as400 printers automagically
#   as the computer boots and shut it down, upon request.
#
#  Under the start) section -- make sure you set up the printer
#   names so that they match tn5250rc!!

# all this script does is set the PATH, and then launch lp5250d:
lp5250d=/usr/local/bin/lp5250d-loader.sh

#exec >/dev/null

. /etc/rc.d/init.d/functions

case $1 in
start)
     echo -n "Starting lp5250d sessions:" >&2
     daemon "${lp5250d} PRT01"
     daemon "${lp5250d} PRT02"
     daemon "${lp5250d} PRT03"
     echo
     touch /var/lock/subsys/lp5250d
     ;;

stop)
     echo -n "Shutting down lp5250d:" >&2
     killproc lp5250d
     echo
     rm -f /var/lock/subsys/lp5250d
     ;;

*)
     echo "usage: `basename $0` {start|stop}" >&2
     exit 1
     ;;

esac



This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].