Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature for usr.sbin/newsyslog.c: accept human unit suffix for size fileds in configuration file. #1505

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Rin0913
Copy link

@Rin0913 Rin0913 commented Nov 1, 2024

In previous versions of newsyslog, the size had to be configured in KB, which is too small for modern computers.

With this update, we can use three types of units: K, M, and G. For example,

# logfilename          [owner:group]    mode count size when  flags [/pid_file] [sig_num]
/var/log/all.log                        600  7     *    @T00  J
/var/log/auth.log                       600  7     1000 @0101T JC
/var/log/console.log                    600  5     100M *     J
/var/log/cron                           600  3     1G   *     JC
/var/log/daemon.log                     644  5     1000K @0101T JC

@lwhsu
Copy link
Member

lwhsu commented Nov 1, 2024

I think we can use expand_number(3) from libutil?

@lwhsu
Copy link
Member

lwhsu commented Nov 1, 2024

And we may also need to update manual page to indicate that we can use human readable format.

@Rin0913
Copy link
Author

Rin0913 commented Nov 1, 2024

The manual will look like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants