SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is what /etc/rc.d/rc.M says on my Slackware machine (13.1, soon to be 14.2):
Code:
# Turn on process accounting. To enable process accounting, make sure the
# option for BSD process accounting is enabled in your kernel, and then
# create the file /var/log/pacct (touch /var/log/pacct). By default, process
# accounting is not enabled (since /var/log/pacct does not exist). This is
# because the log file can get VERY large.
if [ -x /sbin/accton -a -r /var/log/pacct ]; then
chmod 640 /var/log/pacct
/sbin/accton /var/log/pacct
fi
Does your /var/log/pacct file respect ''640'' (rw-r-----) in terms of rights?
Also, please note the warning contained in the comments...
Turns process accounting on or off, or changes the file where this
info is saved.
OPTIONS:
-h, --help Show help and exit
-V, --version Show version and exit
ARGUMENTS:
on Activate process accounting and use default file
off Deactivate process accounting
ACCOUNTING_FILE Activate (if not active) and save information in
this file
The system's default process accounting file is '/var/log/pacct'.
Report bugs to <bug-acct@gnu.org>
So then I ran accton off & accton on and I'm finally seeing activity!
SO looking over man showing; on|off|filename I don't get why the rc.M entry is not working?
if [ -x /sbin/accton -a -r /var/log/pacct ]; then
chmod 640 /var/log/pacct
/sbin/accton /var/log/pacct
echo "Process accounting turned on"
fi
/sbin/accton /var/log/pacct is not working, is this working for others? If so, since I didn't do a full install of slack, could I be missing something needed, to make this function?
The issue is that (if I understand well) you are turning process accounting on and off several times, without restarting your system.
The /etc/rc.d/rc.M file is executed only once, as the system is going into multi-user mode.
If turning process accounting on and off is what you are looking for, then you should probably run the commands you listed in order to run or stop process accounting.
Please be aware that turning process accounting on consumes a lot of disk space in the log file -- this is why I mentioned the warning (followed by a )
No, if I restart the system with the stock 4.4.14 kernel then rc.M is working to start acct and I see logging happening.
If I restart with my kernel I compiled 4.4.18 I am not seeing rc.M working, it does say at the console that Process Accounting is on, but the logs are empty and lastcomm shows nothing.
So for now I'm trying to figure out what I'm missing in the kernel, I thought all I needed was the BSD Process Accounting, which I have all the same options compiled in as the stock kernel.
so, start with a diff of the configs between stock kernel and your kernel, and see if you find anything that looks relevant, then try changing that and see if it works.
then you'd go over the changes one by one until you get a kernel that works for you..
Yes what's relevant to Accounting is the question here, and who knows the answer?
I certainly know all the differences I've made to the kernel, but none of them stick out as Accounting related.
Here's the real kicker, acct works, it just doesn't run from an rc script, as I mentioned before. As root, once logged into X I can run it manually and it's working, but for some odd reason, most of the time I have to rm /var/log/pacct then touch /var/log/pacct and chmod 640 /var/log/pacct THEN accton on and it's working....
If the support to work wasn't there, then running it manually would have no effect, the problem here really is, what is in the stock kernel allowing it to start from the rc.M script?
I spent the entire day a few days ago going over this, numerous times recompiing the kernel over.
I finally came to realize one thing, there seems to be a bug here with this application, in what respect, I don't know, but let me explain, what I finally came to conclude, and if this is not a bug here, then hopefully someone can explain what is going on...
I grabbed at the below URL the config-huge 4.4.14 kernel config of Slackware;
I made only 2 changes to this kernel and then compiled it.
1. I removed 'CONFIG_BLK_DEV_INITRD' - Initial RAM filesystem and RAM disk (initramfs/initrd) support
I also do not even use this on my box, so I don't see how/why this would also have an effect.
2. Next I changed the CONFIG_DEFAULT_HOSTNAME="darkstar" to the hostname of 'none', another option I do not see how/why this would also have an effect.
3. When I rebooted this kernel and logged into the console, lastcomm did not show anything, I then tried running accton off & accton on, still nothing working, then when I logged into X and ran accton off & accton on, then lastcomm worked.... Hmm
4. Here is the rc.M entry calling this at startup;
if [ -x /sbin/accton -a -r /var/log/pacct ]; then
chmod 640 /var/log/pacct
/sbin/accton /var/log/pacct
fi
How can this not work at startup and not turn on acct, when only removing 'Initial RAM filesystem and RAM disk' when it's not even being used on the box, and changing the hostname in the kernel? If I don't change these options it works. Also then, why wouldn't accton on work out in the console, but it then works in X?
I don't see how this is a problem with Slackware, there appears to be some kind of odd bug with acct.
Now this isn't just the end of the insanity, I can leave these 2 options alone and change anything in the kernel, and for some reason it still acts up the same way. I'm not saying everything you change causes it not to work, but changes that are not even related to BSD Process accounting...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.