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.
I am trying to set the hidepid value to 2 for /proc at boot. This is how the proc entry appears in my /etc/fstab.
Code:
proc /proc proc defaults,hidepid=2 0 0
However, it is not set at boot, and instead it just uses the default mount options. Remounting /proc with hidepid=2 works. It just won't set at boot. I have also tried setting rw,relatime,hidepid=2 instead of defaults, but that doesn't work either.
Running most up to date Slackware64 -current with 4.19.75 generic kernel.
Any help would be appreciated as to why this isn't occurring at boot.
Any help would be appreciated as to why this isn't occurring at boot.
/proc isn't mounted through the fstab entry, just like /dev/root it is accessed by the kernel much earlier in the boot process. In fact /proc and /sys do not need fstab entries at all as they're auto-mounted anyway. My system doesn't have any entries for either /proc or /sys and still "mount" shows them as mounted, before any of the /etc/fstab entries are shown (like usbfs, which is mounted below /proc):
Quote:
/dev/sda1 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
usbfs on /proc/bus/usb type usbfs (rw,devmode=0666)
An optional fstab entry will - just as for the root fs - only be used when you use a "remount" command, i.e. in rc.local
PS: that the root is shown as /dev/sda1 is because of a remount in the rc.S script
Quote:
# Remount the root filesystem in read-write mode
echo "Remounting root device with read-write enabled."
/sbin/mount -w -v -n -o remount /
because now udev is active, so all devices have been created.
AFAIK there's no kernel boot parameter to influence the way /proc is mounted and you need to remount it if you want to change the mount options. You could either remount it automatically at boot time with the help of the rc init scripts (/etc/rc.d/rc.local would be more appropriate(clean/non-invasive)) and add your hidepid=2 , or, you can prepare an initrd.img and add your special mount option there, as suggested here: https://unix.stackexchange.com/quest...tently-at-boot
And it does just that. Users can only see their own processes. All is well!
Now when I try to accomplish the same with Slackware64 current, it just doesn't seem to work no matter what I try
Do you use initrd? The init script inside initrd mounted the /proc early before switching to the real root. Try modifying that script (check inside your initrd-tree directory, which by default is /boot/initrd-tree).
Do you use initrd? The init script inside initrd mounted the /proc early before switching to the real root. Try modifying that script (check inside your initrd-tree directory, which by default is /boot/initrd-tree).
It happens with and without initrd. I also tried modifying the initrd image and it still didn't work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.