[opensuse] Script fails for unknown reason



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



Relevant Pages

  • Re: Entourage account setup applescript not working
    ... I pasted the script at the end just in case. ... When comparing the account settings on 2 computers, ... This script assists a user with the setup of his Exchange account ... Customize the network and server properties below with information ...
    (microsoft.public.mac.office.entourage)
  • Re: Chage script for Linux servers?
    ... I'm looking for a script that allows control of account expiration ... I have complete control over the server in question. ...
    (comp.lang.php)
  • Re: User access & security
    ... If there is a user with non-root access to their account, we are dependent on their having a good password to ward off too much nasty activity. ... to do (permissions permissions permissions)). ... lately most attacks against webservers seem to target vulnerable php, perl script and spawn a custom script, ... which is located at some anonymous or compromised server, which launches a reverse shell so ... ...
    (comp.os.linux.security)
  • Re: Chage script for Linux servers?
    ... I'm looking for a script that allows control of account expiration ... I have complete control over the server in question. ...
    (comp.lang.php)
  • Re: How do u get around expiring password problems
    ... changepassword method, in fact you should be able to have the mainframe script ... has the ability to set the password of that account. ... Joe Richards Microsoft MVP Windows Server Directory Services ... >>server runs a second script which sets the password on the account. ...
    (microsoft.public.win2000.security)