-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I do not know if many of you use lisa, but IMHO it is one of the things
that *should* work out-the-box (windows users expect this kind of thing
funnily enough).
So, I have a new attempt at improving the lisa init script. Those of you
who have used lisa, please save the attached file (lisa.init) as
/etc/rc.d/init.d/lisa. Then rename your current /etc/lisarc, and restart
lisa:
# mv /etc/lisarc /etc/lisarc.backup
# service lisa restart
Tell me if your lisa works at all.
I am just using the ip/netmask from the first eth* route listed by
'route -n'. It seems lisa only works with one subnet anyway, and it
seems that the internal route happens to be first most of the time (I do
not see an easy way to find which is internal ...).
Anyway, that works for me. The idea with the AUTOINITCONFIG variable was
that a manual config (with 'kcmshell kcmlisa' at present, since it is
missing in KDE Control Center) would overwrite the file and remove the
variable, so the next restart would not be automatic, but it does not
quite work. Ideally though, this should not be necessary. Suggestions?
Then, I would like lisa to be restarted anytime an interface goes
up/down. I have the following:
[EMAIL PROTECTED] bgmilne]# cat
/etc/sysconfig/network-scripts/ifup.d/lisa
#!/bin/bash
INITSCRIPT=/etc/rc.d/init.d/lisa
[ -x $INITSCRIPT ] && $INITSCRIPT restart
[EMAIL PROTECTED] bgmilne]# ll
/etc/sysconfig/network-scripts/ifup.d/lisa
- -rwxr-xr-x 1 root root 87 Feb 26 20:12
/etc/sysconfig/network-scripts/ifup.d/lisa*
(same for ifdown.d), but I get an empty IP/netmask in the config file
when restarting the network.
Any ideas?
- --
|--------------Another happy Mandrake Club member--------------|
Buchan Milne Mechanical Engineer, Network Manager
Cellphone * Work +27 82 472 2231 * +27 21 8828820x121
Stellenbosch Automotive Engineering http://www.cae.co.za
GPG Key http://ranger.dnsalias.com/bgmilne.asc
1024D/60D204A7 2919 E232 5610 A038 87B1 72D6 AC92 BA50 60D2 04A7
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE+XQbJrJK6UGDSBKcRApriAJwKBPC/apS7lq6YXSdtdBLaMSVTswCfYv75
w6pUrXu1xf6c1Z4TDZ5YRZg=
=fkLB
-----END PGP SIGNATURE-----
#!/bin/sh
#
# Startup script for LISa
#
# chkconfig: 345 92 8
# description: Starts and stops the LAN Information Server used \
# to provide a LAN browser.
# processname: lisa
#
# based on rclisa Version 0.1
# 2001 by Marcus Thiesen ([EMAIL PROTECTED]) for SuSE Linux 7.1
# This is free and comes with absolutely no WARRANTY
# adapted for Mandrake 8.0 by Patrick Alberts ([EMAIL PROTECTED])
# Updated for Mandrake 9.0 by Buchan Milne ([EMAIL PROTECTED])
CONFIG_FILE=/etc/lisarc
prog="lisa"
# Source function library.
if [ -f /etc/init.d/functions ] ; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Get config.
. /etc/sysconfig/network
# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
exit 0
fi
# check how we were called
case "$1" in
start)
PID=`pidof -s lisa`
if [ -z "$PID" ]; then
if [ -e /usr/bin/lisa ]; then
#Should we auto-generate or not?
INITAUTOCONFIG=0
#check for config file:
if [ -e $CONFIG_FILE ]; then
#If we have a config file, source it to see if we
#should autogenerate
. $CONFIG_FILE
else
#We do not have a config file, so autogenerate
INITAUTOCONFIG=1
fi
if [ $INITAUTOCONFIG -eq 1 ];then
gprintf "No config file, generating one, please run kcontrol
as root to customise\n"
# Take first route as only interface to worry about:
IPNMS=`/sbin/route -n |awk '/eth/ {print $1"/"$3}'|head -n1`
echo "AllowedAddresses=$IPNMS" > $CONFIG_FILE
echo "BroadcastNetwork=$IPNMS" >>$CONFIG_FILE
echo "DeliverUnnamedHosts=0" >>$CONFIG_FILE
echo "FirstWait=30" >> $CONFIG_FILE
echo "MaxPingsAtOnce=256" >>$CONFIG_FILE
echo "PingAddresses=">> $CONFIG_FILE
echo "PingNames=" >> $CONFIG_FILE
echo "SearchUsingNmblookup=1">> $CONFIG_FILE
echo "SecondWait=-1">> $CONFIG_FILE
echo "UpdatePeriod=300" >> $CONFIG_FILE
echo "INITAUTOCONFIG=1" >>$CONFIG_FILE
fi
if [ -e $CONFIG_FILE ]; then
action "Starting %s: " "$prog" /bin/true
/usr/bin/lisa -c $CONFIG_FILE >/dev/null 2>&1
else
action "No configuration available, not starting LISa"
/bin/false
fi
else
action "Starting %s: binaries not found " "$prog" /bin/false
fi
else
action "Starting %s: already running (%s) " "$PID" "$prog" /bin/false
fi
touch /var/lock/subsys/lisa
;;
stop)
PID=`pidof -s lisa`
if [ "$PID" ]; then
action "Stopping %s: " "$prog" kill -3 $PID
fi
rm -f /var/lock/subsys/lisa
;;
status)
PID=`pidof -s lisa`
if [ "$PID" ]; then
gprintf "%s is running! ($PID)\n" "$prog"
kill -SIGUSR1 $PID;
sleep 3
else
gprintf "%s is not running!\n" "$prog" ;
fi
;;
restart)
$0 stop && $0 start
;;
refresh)
PID=`pidof -s lisa`
if [ "$PID" ]; then
gprintf "Sending %s a SIGHUP ($PID)\n" "$prog"
kill -SIGHUP $PID;
else
gprintf "%s is not running!\n" "$prog" ;
fi
;;
*)
gprintf "usage: %s {start|stop|status|refresh|restart}\n" $0
;;
esac
exit 0