Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I set up my rsyslogd.conf setting so:

auth,authpriv.*                 username

but username does not get the messages (in (all) his pseudo-terminals i.e Gnome terminals). My questions related to this:

  1. should the user see the messages? if yes, what could be the cause, that the user does not get the messages.
  2. if no, is it possible to do that?
share|improve this question

1 Answer 1

up vote 1 down vote accepted

The username syntax is deprecated in rsyslog. Use :omusrmsg:username instead.

If it still does not work:

rsyslog uses the /var/run/utmp file to find a list of the user's ttys; terminal emulators have to add themselves to that file, and this requires sufficient privileges (the file is usually not world-writable). X11-based terminal emulators are different from system login programs, in that they start with the user's, not root's, privileges.

Use pinky, finger, w, or who to list the contents of utmp. If they do not list any "pts/X" entries belonging to pseudo-terminals:

  1. First make sure /var/run/utmp exists, is owned by the utmp group and is writable by that group. If not, run

    # chown :utmp /var/run/utmp && chmod ug=rw,o=r /var/run/utmp
    
  2. Then check if your terminal emulator has sufficient privileges to write to that file – namely, the setgid bit and correct group ownership:

    -rwxr-sr-x 1 root utmp 1.3M May 25  2012 /usr/bin/urxvt
    -rwxr-sr-x 1 root utmp 475K Nov 26 16:54 /usr/bin/xterm
    -rwxr-sr-x 1 root utmp  15K Nov 13 00:36 /usr/lib/vte/gnome-pty-helper
    

    Note: GNOME Terminal uses a separate gnome-pty-helper tool to perform utmp changes.

    If any are missing, run:

    # chown :utmp /usr/lib/vte/gnome-pty-helper \
        && chmod g+s /usr/lib/vte/gnome-pty-helper
    
  3. Make sure rsyslogd is running as an account that is allowed to write to users' ttys. If necessary, add it to the tty group.

  4. In some distributions, check if the SELinux or AppArmor policy allows the utmp updates.

share|improve this answer
    
After changing to the new format :omusrmsg:username I restarted the rsyslogd (/etc/init.d/rsyslogd restart). Of course I checked also step 2 (and I get entries with gnome-pty-helper in the response to w). The problem is that nothing comes (the same syslogd facilities are logged also in a file). –  Andrei I Dec 7 '12 at 21:36
    
any ideas on how to debug further? –  Andrei I Dec 7 '12 at 21:52
    
Which user is rsyslogd running as? –  grawity Dec 7 '12 at 22:06
    
user: syslog. Parameters used by rsyslogd: -c5. And it is a Ubuntu 12.04 system, probably using AppArmor. –  Andrei I Dec 7 '12 at 22:10
    
Actually it is the gnome-terminal, that shows up in the w output. –  Andrei I Dec 7 '12 at 22:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.