LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-27-2011, 02:25 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Question udev Quirk?


Hi All,

Long time no see. My personal schedule has kept me out of circulation for a long time.

Last weekend I ran into a udev quirk.

I was doing some testing. To ensure a clean system for the purposes of my testing, several times I rebooted my system into run level 1. Afterwards I manually ran init 3 to enter run level 3. Every time I entered run level 3, the re-initialization process rendered /dev/shm with 1755 permissions rather than leave alone at 1777. I use /dev/shm as tmpfs (fstab: tmpfs /dev/shm tmpfs defaults,noatime 0 0) and from /etc/bashrc assign $TMP and $TEMP to that location.

Because I assign $TMP and $TEMP to /dev/shm, changing to 1755 creates havoc for non-root users.

I found the problem to be in rc.M when udev is restarted, just after the font cache indexes are rebuilt.

To be certain I was not causing the problem in my own scripts, I temporarily added a ls -la commands just before and after the udev snippet and verified that just before permissions was 1777 and just after the permissions had changed to 1755.

Oddly, if I (re)boot straight into run level 3 the permissions are not affected and remain 1777. The problem occurs only when re-initializing from run level 1 to run level 3.

My lazy solution was to insert a command in rc.local ensuring /dev/shm is 1777. Is there a more elegant way with udev? What is causing this quirk?

Thanks.

Edit: This is on a 12.2 box.

Last edited by Woodsman; 02-27-2011 at 04:51 PM.
 
Old 02-27-2011, 03:16 PM   #2
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
You do no want /dev/shm. In fact, you want to use TMPFS, which is a special type of resize-able ramdisk.

How about to use the right tool? For example, for mounting an TMPFS on /tmp, use this line in /etc/fstab.

Code:
tmpfs           /tmp         tmpfs       defaults          0   0

Last edited by Darth Vader; 02-27-2011 at 03:19 PM.
 
Old 02-27-2011, 03:19 PM   #3
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,508

Rep: Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473
Here on a stock Slackware64 -current, I did not note this issue when going from runlevel 3 to 1 and back again. /dev/shm retained mode 1777, which is the correct mode for that directory. If you use 777, users can remove each other's files which can lead to security holes (and data loss, obviously). Mode 1777 (sticky bit) prevents that.
 
1 members found this post helpful.
Old 02-27-2011, 04:44 PM   #4
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Hi Pat,

My bad for not proofreading my post. I am using the sticky bit 1777. Also, this was on a 12.2 box.

I updated my original post with the corrected information.

Based upon your reply and presumption of using Current, I'll guess that something has changed with udev since 12.2 that causes this odd behavior. I will never pretend to be udev expert, but I found nothing obvious in the rules.

I'm confused why I see this quirk only when manually transitioning from run level 1 to 3 and not when I (re)boot directly into run level 3. Running chmod 1777 /dev/shm in rc.local eliminates the annoyance, but I'd like to know the root cause.

Edit: Adding mode=1777 in fstab does not help.

Last edited by Woodsman; 02-27-2011 at 05:26 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Chose udev for services... udev starts twice... hotplug fails flipjarg Linux - Newbie 2 09-19-2010 12:49 PM
UDEV - SBLive(emu10k) - Mandriva hangs at UDEV during boot.....still! Grrr. peterlowrie Linux - Hardware 2 05-23-2010 06:37 PM
current users - udev-128 - don't forget rc.udev.new! tobyl Slackware 3 10-08-2008 03:28 AM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM
Quirk with Kmail floydking General 0 11-04-2005 05:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration