Linux Admin: Difference between revisions
Jump to navigation
Jump to search
(Managing Alternatives) |
|||
Line 54: | Line 54: | ||
udevadm info -a -p $(udevadm info -q path -n /dev/sda2) # Same as above |
udevadm info -a -p $(udevadm info -q path -n /dev/sda2) # Same as above |
||
udevadm test $(udevadm info -q path -n /dev/sda2) 2>&1 | grep OWNER # Test the effect of a new rule on device /dev/sda2 |
udevadm test $(udevadm info -q path -n /dev/sda2) 2>&1 | grep OWNER # Test the effect of a new rule on device /dev/sda2 |
||
</source> |
|||
== Managing Alternatives == |
|||
For instance, to define the default ''cursor-theme'', use <code>update-alternatives</code>: |
|||
<source lang="bash"> |
|||
sudo update-alternatives --config x-cursor-theme |
|||
</source> |
</source> |
Revision as of 14:52, 5 July 2010
/etc/sudoers
The man page gives a complete but unclear description of the file specification. Here a simplified but complete version:
First the description of possible entries in the file:
# Alias
'User_Alias' NAME '=' User... (':' NAME '=' User... )* |
'Runas_Alias' NAME '=' Runas_Member... (':' NAME '=' Runas_Member...)* |
'Host_Alias' NAME '=' Host... (':' NAME '=' Host... )* |
'Cmnd_Alias' NAME '=' Cmnd... (':' NAME '=' Cmnd... )*
#Default_Entry
'Defaults' ('@' Host... | ':' User... | '!' Cmnd... | '>' Runas_Member...)? Parameter...
#User_Spec
User... Host... '=' Cmnd_Spec... (':' Host... '=' Cmnd_Spec...)*
Now the description of the syntactical elements:
identifier... ::= identifier (',' identifier)*
NAME ::= [A-Z]([a-z][A-Z][0-9]_)*
User /
Runas_Member ::= '!'* ( username | '#'uid | '%'group | '+'netgroup | Alias | 'ALL' )
Host ::= '!'* ( hostname | ip_addr | network(/netmask)? | '+'netgroup | Alias| 'ALL' )
Cmnd ::= '!'* ( command filename (args | '""')? | directory | "sudoedit" | Alias | 'ALL' )
Parameter ::= Parameter '=' Value | Parameter '+=' Value | Parameter '-=' Value | '!'* Parameter
Cmnd_Spec ::= ('(' Runas_Member...? (':' ...? ')')? ('NOPASSWD:'|'PASSWD:'|'NOEXEC:'|'EXEC:'|'SETENV:'|'NOSETENV:')* Cmnd
File Systems
Reiserfs
- For better performance, use mount switch
noatime,notail
(see [1])
udev & devfs
Reference: [2]
This chapter is about the devices in /dev. Since kernel 2.6, the content of this directory is generated by udev rules.
These rules are located at:
- /lib/udev/rules.d
- /etc/udev/rules.d (these can be customized)
Use udevadm to get information on a given device:
udevadm info -q path -n /dev/sda2 # To get the path to the device /dev/sda2
udevadm info -q -n /dev/sda2 # To get all the attributes of device /dev/sda2
udevadm info -a -p $(udevadm info -q path -n /dev/sda2) # Same as above
udevadm test $(udevadm info -q path -n /dev/sda2) 2>&1 | grep OWNER # Test the effect of a new rule on device /dev/sda2
Managing Alternatives
For instance, to define the default cursor-theme, use update-alternatives
:
sudo update-alternatives --config x-cursor-theme