help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vipw with cfengine?


From: skaar
Subject: Re: vipw with cfengine?
Date: Wed, 27 Nov 2002 08:00:12 -0500
User-agent: Mutt/1.4i

* Kai Großjohann (kai.grossjohann@uni-duisburg.de) [021127 07:19]:
> vipw does some magic to lock the file.  Is this also possible with
> cfengine?

     vipw edits the password file while setting  the  appropriate
     locks,  and does any necessary processing after the password
     file is unlocked. If the  password  file  is  already  being
     edited, then you will be told to try again later.  The vi(1)
     editor will be used unless the environment  variable  VISUAL
     or EDITOR indicates an alternate editor.

what you can do is to set EDITOR to ed or ex and echo the your changes
to ed. I do this in a cfexecd startup script where I want to add the
cfexecd -F cronjob when I start cfexecd and really remove it when I stop
it. crontab -e uses EDITOR. The lines below probably only work properly
with bash, and if you want to use them in a init script on Solaris
you're probably better off calling the bash-script from the initscrip as
I believe solaris init will not honor #!/bin/bash.

# remove entry:
echo -e "g/cfexecd/d\nw\n" | crontab -e

# add entry:
echo -e "$\na\n0,30 * * * * /opt/bcs/sbin/cfexecd -F\n.\nw\n" | crontab -e

> 
> -- 
> ~/.signature is: umop ap!sdn    (Frank Nobis)
> 
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine

-- 
/skaar

+-------------------------------------------------------------------+
+----- skaar@aol.net                     kent skaar ----------------+
+----- internet services: infrastructure & security ----------------+
+-------------------------------------------------------------------+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]