sysklogd init script speedup (patch included)
Bug #285530 reported by
Alexander Butenko
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/
third, start-stop-daemon was trying to start sysklogd from syslogd user which was hardcoded in the command args.
To post a comment you must log in.
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/UbuntuDevel opment
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.