Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#20016 - [initscripts] Dropping a subshell and some other fork()s and exec()s

Attached to Project: Arch Linux
Opened by Isaac G (IsaacG) - Tuesday, 29 June 2010, 06:03 GMT
Last edited by Thomas Bächler (brain0) - Tuesday, 07 September 2010, 20:44 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Name : initscripts
Version : 2010.06-2

/etc/rc.sysinit

Line 343: (cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; )

This uses a subshell... for no apparent reason:
/usr/bin/find /var/run ! -type d -exec /bin/rm -f -- {} \;

Unless you are trying to confirm that the path can be entered. As root I think you can cd anywhere?
[[ -d /var/run ]] && /usr/bin/find /var/run ! -type d -exec /bin/rm -f -- {} \;
or
[[ -d /var/run ]] && [[ -x /var/run ]] && /usr/bin/find /var/run ! -type d -exec /bin/rm -f -- {} \;

Rather than doing a new fork/exec on each file, you can do (GNU find):
/usr/bin/find /var/run ! -type d -exec /bin/rm -f -- {} +

Better yet, skip the fork/exec (GNU):
/usr/bin/find /var/run ! -type d -delete

Final version:
[[ -d /var/run ]] && /usr/bin/find /var/run ! -type d -delete
This task depends upon

Closed by  Thomas Bächler (brain0)
Tuesday, 07 September 2010, 20:44 GMT
Reason for closing:  Implemented
Additional comments about closing:  Added in initscripts git, thanks.

Loading...