Mailinglist Archive: opensuse (2217 mails)
| < Previous | Next > |
[opensuse] Script fails for unknown reason
- From: "Theo v. Werkhoven" <theo@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 13 Sep 2007 22:18:17 +0200
- Message-id: <20070913201817.GA8275@xxxxxxxxxxxxxxxx>
Hi list,
This is part of a script to manage accounts of a vsftpd server
It's called after an account is added, deleted or when a password
has been changed.
ftpStat () { /sbin/checkproc /usr/sbin/vsftpd; }
restart_srv() {
/etc/init.d/vsftpd restart
sleep 5
rep=0
until ftpStat ; do
/etc/init.d/vsftpd start
sleep 5
rep=$((rep +=1))
if [ $((rep)) -ge 5 ]; then
echo "There is something wrong with the FTP service.\
Please call the FTP admin"
exit 1
fi
done
echo "The FTP server daemon has been restarted.";
}
The check to see if the server really has restarted is added because
'/etc/init.d/vsftpd restart' would sometimes stop the server, but
not start again appearently (I got calls that the server wasn't
available after someone added an account).
Weirdly enough, despite this check, sometimes it still happens that the
service doesn't restart, but only on an openSUSE10.0 install with
vsftpd-2.0.3-6
When I use the management script at home, on openSUSE 10.2 and with
vsftpd-2.0.5-24 the restart always succeeds the first time without a
hitch.
The users can only sudo this one script btw, so they can not stop
the service intentionally, and there are no errors or warnings in
the logs when the service stopped.
As far as I can see, this function is pretty foolproof, and should
always exit with the service running, but nonetheless, something
breaks (sometimes), and I have no clue why or what.
Does anyone here see something wrong with this script that I don't?
Cheers.
Theo
--
Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org
ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131
SUSE 10.2 + Jabber: muadib@xxxxxxxxxxxxxxxx
Kernel 2.6.20 + See headers for PGP/GPG info.
Claimer: any email I receive will become my property. Disclaimers do not apply.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
This is part of a script to manage accounts of a vsftpd server
It's called after an account is added, deleted or when a password
has been changed.
ftpStat () { /sbin/checkproc /usr/sbin/vsftpd; }
restart_srv() {
/etc/init.d/vsftpd restart
sleep 5
rep=0
until ftpStat ; do
/etc/init.d/vsftpd start
sleep 5
rep=$((rep +=1))
if [ $((rep)) -ge 5 ]; then
echo "There is something wrong with the FTP service.\
Please call the FTP admin"
exit 1
fi
done
echo "The FTP server daemon has been restarted.";
}
The check to see if the server really has restarted is added because
'/etc/init.d/vsftpd restart' would sometimes stop the server, but
not start again appearently (I got calls that the server wasn't
available after someone added an account).
Weirdly enough, despite this check, sometimes it still happens that the
service doesn't restart, but only on an openSUSE10.0 install with
vsftpd-2.0.3-6
When I use the management script at home, on openSUSE 10.2 and with
vsftpd-2.0.5-24 the restart always succeeds the first time without a
hitch.
The users can only sudo this one script btw, so they can not stop
the service intentionally, and there are no errors or warnings in
the logs when the service stopped.
As far as I can see, this function is pretty foolproof, and should
always exit with the service running, but nonetheless, something
breaks (sometimes), and I have no clue why or what.
Does anyone here see something wrong with this script that I don't?
Cheers.
Theo
--
Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org
ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131
SUSE 10.2 + Jabber: muadib@xxxxxxxxxxxxxxxx
Kernel 2.6.20 + See headers for PGP/GPG info.
Claimer: any email I receive will become my property. Disclaimers do not apply.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
| < Previous | Next > |