SYSLOGOUT(8)

πŸ’– SYSLOGOUT(8) β€” the girlies' guide to modular centralized shell logout πŸ’–

okay bestie, welcome to syslogout from the System Manager's Manual. this one's a lil hidden gem and i'm lowkey obsessed with it. let's get into it πŸŽ€


✨ NAME ✨

syslogout β€” a modular centralized shell logout mechanism. that's the whole vibe. modular. centralized. logout. slay.


🌸 SYNOPSIS 🌸

no synopsis, no flags, no nothing. it's a shell script bestie, it just happens to you at logout. iconic behaviour honestly.


πŸ’… DESCRIPTION πŸ’…

so syslogout is a generic approach to enabling centralized shell logout actions for all users of a given system, in a modular and centralized way, and it is mostly aimed at avoiding work for lazy sysadmins. we love an efficient queen. 🫢

it has only been tested to work with the bash shell, fr fr. don't come for me.

here's the tea: it basically consists of the small /etc/syslogout shell script, which invokes other small shell scripts having a .bash suffix, which are contained in the /etc/syslogout.d/ directory. that's it. that's the whole mechanism. πŸ’–

the system administrator can drop in any script he wants β€” no naming convention required, other than that the scripts need to have a .bash suffix, to enable automagic sourcing by the /etc/syslogout script. automagic. i said what i said. ✨

πŸ¦‹ for shell sessions πŸ¦‹

for shell sessions, the contents of /etc/syslogout.d/ will be sourced by every user at logout if the following lines are present in his $HOME/.bash_logout:

if [ -f /etc/syslogout ]; then
    . /etc/syslogout
fi

copy paste that into your $HOME/.bash_logout and you're golden. no cap. 🌟

🧚 for X sessions 🧚

if used for X sessions, it is advisable to include the former statement into the Xreset script of the X display manager instead β€” this is to prevent that closing of a terminal emulator window yields unexpected results in your running X session, if your X11 terminal emulator is using a login shell. 😭 please don't skip this part bestie, it's giving chaos otherwise.

be sure then to run it under the user-id of the X session's user. see the example files in /usr/share/doc/syslogout/ for illustration. πŸŽ€

πŸ™ˆ how to opt out πŸ™ˆ

users not wanting /etc/syslogout to be sourced for their environment can easily disable its automatic mechanism. it can be disabled by simply creating an empty file called $HOME/.nosyslogout in the user's home directory, using e.g. the touch(1) command. so simple. so clean. πŸ’…

πŸ‘‘ the override system (this part ate) πŸ‘‘

any single configuration file in /etc/syslogout.d/ can simply be overridden by any user, by creating a private $HOME/.syslogout.d/ directory, which may contain a user's own version of any configuration file to be sourced instead of the system default. its names have just to match exactly the system's default /etc/syslogout.d/ configuration files. match the name or it does not work, periodt. ⭐

empty versions of these files contained in the $HOME/.syslogout.d/ directory automatically disable sourcing of the system wide version. empty file = off switch. the way that works is genuinely so clever.

and naturally, users can add and include their own private scripts to be automagically executed by /etc/syslogout at logout time. build your own lil logout ritual. 🌈


πŸ’€ OPTIONS πŸ’€

there are no options other than those dictated by shell conventions. anything is defined within the configuration scripts themselves. that's it. no -h, no --help, no nothing. the scripts are the options. main character energy honestly. πŸ’œ


🌸 SEE ALSO 🌸

  • the README files and configuration examples contained in /usr/share/doc/syslogout/
  • the manual page for bash(1), xdm(1x), xdm.options(5), and wdm(1x)
  • recommended further reading is everything related with shell programming πŸ“š

if you need a similar mechanism for executing code at login time, check out the related package sysprofile(8), which is a very close companion to syslogout. they're a matching set bestie, get both. 🫢


😭 BUGS 😭

okay so, real talk:

syslogout in its current form is mainly restricted to bash(1) syntax. in fact it is actually a rather embarrassing quick and dirty hack than anything else β€” but it works. πŸ”₯

it serves the practical need to enable a centralized bash configuration until something better becomes available.

your constructive criticism in making this into something better is very welcome. and before i forget to mention it: we take patches... ;-) β€” the original author said that, i'm just the messenger. πŸ’–


πŸŽ€ AUTHOR πŸŽ€

syslogout was developed by Paul Seelig <pseelig@debian.org> specifically for the Debian GNU/Linux system. πŸ’œ

feel free to port it to and use it anywhere else under the conditions of either the GNU public license or the BSD license or both. better yet, please help to make it into something more worthwhile than it currently is. that's the dream, honestly. 🌟


πŸ’Œ and that's a wrap on the System Manager's Manual entry for SYSLOGOUT(8). go forth, source your logout scripts, and be the centralized sysadmin of your dreams. byeee bestie, stay slaying πŸ’…βœ¨πŸ¦‹
πŸ“¦ where this page comes from