I recently started working for a client that uses OpenVPN. I have really only had experience with Cisco VPNs up to this point (and the VPNC client). While troubleshooting my new connection, I noticed that every time I either connected to or disconnected from a VPN using NetworkManager, it produced this error in my daemon.log:
nm-dispatcher.action: Script '/etc/NetworkManager/dispatcher.d/01ifupdown' exited with error status 1.
After searching a bit on Google, I found this bug that said the actions passed to the
01ifupdown script by NetworkManager were
vpn-down. Since those actions were not handled explicitly in the script, they were throwing an exception as designed. NetworkManager should not be calling the script with an undefined action. There was a trivial patch attached, which basically addressed the two missing actions by adding
vpn-up to the
up case and
vpn-down to the
--- 01ifupdown 2010-01-04 11:51:45.732239244 +0000 +++ 01ifupdown.new 2010-01-04 11:51:27.080203723 +0000 @@ -17,7 +17,7 @@ # Run the right scripts case "$2" in - up) + up|vpn-up) export MODE="start" export PHASE="up" @@ -32,7 +32,7 @@ exec run-parts /etc/network/if-up.d ;; - down) + down|vpn-down) export MODE="stop" export PHASE="down"
Success! No action and no more error messages either. It appears that this is fixed in future versions of NetworkManager (i.e. Natty Narwhal) but not yet in Lucid Lynx or Maverick Meerkat.
I was a bit confused as to why my
/var/log/syslog was getting rotated every day, while everything else was weekly, or handled directly by a specific configuration in
The script at
/etc/cron.daily/syslogd will rotate all files that are the output
syslogd-listfiles each day. The same script at
/etc/cron.weekly/syslogd will rotate all files that are the output of
syslogd-listfiles --weekly on a weekly basis.
syslogd-listfiles is controlled by
/etc/syslog.conf. Near the top of the configuration file, you’ll see the configuration for syslog:
The “*.*” is an ‘everything’ directive (see my $everything in
/usr/sbin/syslogd-listfiles). My goal was to preserve my syslog for more than seven days since it is a relatively inactive machine. I ended up adding a new directive to allow the syslog (and auth) messages to be logged and rotated every day, and logged to syslog which will only be rotated once a week.
*.*;auth,authpriv.none -/var/log/syslog_everything syslog.*;auth,authpriv.none -/var/log/syslog
It might be a bit clumsy but it solves my two problems, by creating two syslogs.
- I need *.* to be logged somewhere as a catchall
- I want syslog to be rotated only once a week
You definitely do not want to do this on a busy machine, but if your syslogs are not that big and you want to keep them around a while, this is a good way to accomplish that.
I like to use set_locale and money_format in my applications for flexibility. You never know when you’re going to go global! 😉 I had been using RedHat for a long time, and switched to Debian as I like the distro a lot better. I couldn’t get set_locale to work. Here’s what I was trying, which is almost straight out of the PHP online manual:
<?php setlocale(LC_MONETARY, 'en_US'); echo money_format('%.2n', $amount); ?>
But no joy. I finally figured out that the locales are a bit different in Debian. You can use the ‘locale’ command to show what locales are actually installed on your server:
silver:~# locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= silver:~# locale -a C en_US.utf8 POSIX silver:~#
You can see that the locale on Debian is actually ‘en_US.utf8’. A quick change and my money formatting code was back to it’s old self.
<?php setlocale(LC_MONETARY, 'en_US.utf8'); echo money_format('%.2n', $amount); ?>
My preference for server side Linux is Debian 4. As with most distributions, most of the system files are rotated on a daily, weekly, and monthly basis by logrotate. For example, in Debian the log files for apache2, aptitude, and clamav are all handled by logrotate, and the configuration files are located in /etc/logrotate.d/
create 640 root www-data
if [ -f /var/run/apache2.pid ]; then
/etc/init.d/apache2 restart > /dev/null
I was finding that my postfix log, mail.log, was getting rotated more often, even though it was really not very large. Sometimes it would rotate every day, sometimes every two days. But I couldn’t find any logrotate config files for the postfix logs. After a bit of searching I discovered that the mail facilities are handled by savelog, which operates in sysklogd. sysklogd is a script that runs in the daily cron at /etc/cron.daily/sysklogd.
A bit of the script is here, and you can see the savelog command:
for LOG in `syslogd-listfiles`
if [ -s $LOG ]; then
savelog -g adm -m 640 -u root -c 7 $LOG >/dev/null
So what is syslogd-listfiles? It will show you all files that are to be logged with syslogd.
silver:/etc/cron.daily# syslogd-listfiles --all