sysklogd init script speedup (patch included)

Bug #285530 reported by Alexander Butenko
6
Affects Status Importance Assigned to Milestone
sysklogd (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: sysklogd

first of all, fix_log_ownership was doing per file chown instead of all files at a time.

second, i wiped syslog uid detection in favor of defining user in /etc/default/sysklogd

third, start-stop-daemon was trying to start sysklogd from syslogd user which was hardcoded in the command args.

Revision history for this message
Alexander Butenko (avb) wrote :
Revision history for this message
Alexander Butenko (avb) wrote :
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Alexander, thanks for these suggestions. Can you please attach your file changes as patches? A good way to make a patch is: diff -Nurp old-file new-file. See also https://wiki.ubuntu.com/UbuntuDevelopment

I have just been looking at the same fix_log_ownership function. To speed it up further, we could get rid of calling syslogd-files, and parse the configuration file ourselves:

chown -f :adm $(awk '/^[^#]/{gsub("^-","",$2); if (match($2,"^/var/log")) print $2 }' /etc/syslog.conf)

This speeds up execution 10-20 times. It would also avoid using perl in the boot which saves memory and time.

But the right fix would to make sure these files are created with the right group from the start. Doing repair and fix-up of what other programs did wrong should not be necessary in the boot process.

Revision history for this message
Alexander Butenko (avb) wrote :

Tormod, sorry, im extremely busy this days. Feel free to use fixes without any credits. Its np.

Or i will come back in a while after i will finish things

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Thanks. I will try to get rid of the chown'ing in the init script, see bug #290127.

Your wiping of the uid detection is a good idea, will look at it later if you don't beat me to it.

Revision history for this message
Alexander Butenko (avb) wrote :

Tormod,

Here is a diff, which clearly applied to a jaunty init script.
It also using your awk parser instead of syslogd-files.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.