4

Why is the logrotate's bin path /usr/sbin on Debian (at least "wheezy”) knowing that we can actually use it without the root privilege?

Steven
  • 28,386
JeanCaron
  • 165

2 Answers2

8

The path for logrotate is placed in /usr/sbin likely, because it is a system administration utility which is generally executed once all filesystems are mounted.

logrotate(8) - Linux man page

logrotate is designed to ease administration of systems that generate large numbers of log files.


Linux Foundation - Filesystem Hierarchy Standard - /sbin System binaries

Utilities used for system administration (and other root-only commands) are stored in /sbin, /usr/sbin, and /usr/local/sbin. /sbin contains binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin. Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin.

Note: Many utilities in the sbin directories can be used by regular users. Any user can run ifconfig to get information about the active network interfaces. Of course, using ifconfig to modify network interface settings would require additional permissions.

Steven
  • 28,386
2

A user process can use logrotate in /usr/sbin, but only for its own logs. Root runs logrotate from cron to do it for all users. A suid bit on it is convenient, but less secure.

bbaassssiiee
  • 1,525