mgetty logfiles
Marc SCHAEFER (schaefer@alphanet.ch)
Tue, 22 Apr 1997 21:10:24 +0200
Udo Erdelhoff (udo@iml.fhg.de) wrote:
> I'm using mgetty-1.0.0 on a Sun Sparcstation 2 with SunOS 4.1.3. Almost
> everything works fine, only the logfiles give me a lot of trouble. I need
> to archive mgetty's logfiles on a weekly basis. Unfortunatelz, mgetty
> keeps his logfile open. I can create a backup of the logfile without
> problems; if I try to cut it (cp /dev/null /var/log/mgetty.log.cua0),
> things get ugly ...
I do it that way:
mv logfile tempfile
kill `cat /var/run/mg-pid.ttyS0
Of course you also kill whoever is logging in at that time, so ...
Other idea:
mv temp-file the_file
mv logfile temp-file
In that case, you have one day (supposing you do it every day) for
the log-file to be closed by mgetty.
.