251 reputation
1311
bio website valentin.hilbig.de
location DE
age
visits member for 3 years, 11 months
seen Aug 22 at 2:21

Unix-Geek


Oct
4
awarded  Necromancer
Sep
24
awarded  Autobiographer
Jul
12
comment Switch on PAM debugging to Syslog
Please note that all lines like pam_* actually are PAM realated. The other lines are output by the tools anyway, regardless if they use PAM or not. This means: If PAM denies, for any reason, it is really hard to find the real cause, if it is in PAM. The non-PAM lines are not helpful (as the problem sits in PAM) and the PAM lines are often not helpful, too, as they are often too silent. With the presence of many PAM modules you really have a hard time guessing which module might be the culprit, let alone to find out how to enable debugging, as this is different for each single one.
Jul
12
comment Switch on PAM debugging to Syslog
/var/log/auth.log is syslog. The problem is not logging but debugging. If for example the PAM stack fails early, you will not see anything, because the modules which output to syslog are not invoked at all. Or something fails and something not, but both log exactly the same lines. It is correct that, I guess, 95% of all cases can be solved by looking into the usual logs, but 5% cannot, as there simply is no trace of what really happens behind the scenes.
Apr
30
awarded  Nice Question
Feb
22
comment Command to prepend string to each line?
awk -v T="[TEST %Y%m%d-%H%M%S] " '{ print strftime(T) $0 }' to output a timestamp
Feb
22
answered Command to prepend string to each line?
Feb
21
comment Command to prepend string to each line?
sed X cmd does read cmd and does not execute it. Either cmd | sed 's/^/[ERROR] /' or sed 's/^/[ERROR] /' <(cmd) or cmd > >(sed 's/^/[ERROR] /'). But beware the latter. Even that this allows you to access the return value of cmd the sed runs in background, so it is likely you see the output after cmd finished. Good for logging into a file, though. And note that awk probably is faster than sed.
Feb
21
comment Command to prepend string to each line?
T="[ERROR] " awk '{ print ENVIRON["T"] $0 }' or T="[ERROR]" awk '{ print ENVIRON["T"] " " $0 }'
Feb
21
comment Command to prepend string to each line?
awk -vT="[ERROR] " '{ print T $0 }' or awk -vT="[ERROR]" '{ print T " " $0 }'
Feb
20
comment Switch on PAM debugging to Syslog
Thanks. Good hint. I'll try if I ever have problems again. So hopefully never .. ;)
Jan
3
comment why is kswapd using high CPU on an idle system?
Please note that the kswap hanging at 100% was confirmed being a Linux bug. It was fixed in mid/end 2012 kernels.
Dec
21
awarded  Revival
Dec
21
awarded  Yearling
Nov
14
awarded  Famous Question
May
26
comment LVM thin provisioning
But it is currently disabled in Wheezy (LVM 2.02.95-7) as thin_check binaries are missing.
May
24
comment How to find the gateway IP address in Linux
I would suggest something like route -n|awk '$4~/G/{print $2; exit(0)}' for the first gateway, but ip route get IP is better, because it lists the route which would be really taken to the given IP, which is difficult to find with route alone
May
24
comment How to find the gateway IP address in Linux
read x x i x< <(ip r g 1), result is in variable $i for further use
Mar
28
comment Unix shell: easy way to get IP from hostname
Because shell traditionally is seen as scripting, not programming ;)
Mar
28
answered How do I tell what process is causing kswapd to be in use?