HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sudo log to cronolog
Operating System - HP-UX
1832574
Members
3463
Online
110043
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2007 09:10 PM
07-26-2007 09:10 PM
sudo log to cronolog
Hi,
unfortunately, hpux doesn't come with some nifty logrotation mechanism like all Linux distros have with logrotate.
Because I was forced to elevate users' privileges for many tasks I need to run sudo with a couple of rules.
As these are frequently used sudo produces lots of clutter to syslog.log.
So I first prevented it from sending to syslogd by a Defaults !syslog directive and providing an own logfile sudo.log.
However, this still grows relatively quickly,
and I would want to have it rotated automatically.
So I got cronolog which originally was meant as
a substitute for Apache's rotatelog.
The pitfall is, while apache is prepared to log to stdout (viz. to a pipe), visudo complains when I try to write this rule to the sudoers file:
Defaults !syslog, logfile = "|/usr/local/sbin/cronolog /var/adm/syslog/sudo%d.log"
...
"/opt/iexpress/sudo/etc/sudoers.tmp" 47 lines, 1238 characters
visudo: values for `logfile' must start with a '/'
What now?
So it has no notion of pipes, as it seems.
I tried to provide a mkfifo file,
but this won't work since all sudo commands would block until some other process would read from the pipe.
Maybe this could be solved using a unix domain socket?
Has anyone an idea how to reconcile sudo with cronolog?
unfortunately, hpux doesn't come with some nifty logrotation mechanism like all Linux distros have with logrotate.
Because I was forced to elevate users' privileges for many tasks I need to run sudo with a couple of rules.
As these are frequently used sudo produces lots of clutter to syslog.log.
So I first prevented it from sending to syslogd by a Defaults !syslog directive and providing an own logfile sudo.log.
However, this still grows relatively quickly,
and I would want to have it rotated automatically.
So I got cronolog which originally was meant as
a substitute for Apache's rotatelog.
The pitfall is, while apache is prepared to log to stdout (viz. to a pipe), visudo complains when I try to write this rule to the sudoers file:
Defaults !syslog, logfile = "|/usr/local/sbin/cronolog /var/adm/syslog/sudo%d.log"
...
"/opt/iexpress/sudo/etc/sudoers.tmp" 47 lines, 1238 characters
visudo: values for `logfile' must start with a '/'
What now?
So it has no notion of pipes, as it seems.
I tried to provide a mkfifo file,
but this won't work since all sudo commands would block until some other process would read from the pipe.
Maybe this could be solved using a unix domain socket?
Has anyone an idea how to reconcile sudo with cronolog?
Madness, thy name is system administration
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP