slack(8)

๐Ÿ’– NAME ๐Ÿ’–

slack โ€” the sysadmin's lazy autoconfiguration kit ๐Ÿงšโœจ

Like, it's the master command, bestie. It's giving "I don't wanna do this by hand" and honestly? Iconic.


๐ŸŒธ SYNOPSIS ๐ŸŒธ

slack [option ...] [role ...]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so slack is the master command, right? It's the main character ๐Ÿ‘‘ and it coordinates everything its backends do. And those backends are out here doing a lot:

  • determining the list of roles to be installed on this server
  • creating a local cached copy of the role files from the central repository
  • merging file trees from subroles into one single, unified tree
  • installing files onto the local filesystem
  • running scripts before and after installation

And the options you hand to slack? They get passed along to the backends where relevant. Like, they share. We love a collaborative queen ๐Ÿซถ


โœจ OPTIONS โœจ

  • -h, --help โ€” prints a usage statement. Your little "what do I do" moment ๐Ÿ’…
  • --version โ€” prints the version and dips out. periodt.
  • -v, --verbose โ€” more verbosity, bestie. You can stack this one multiple times ๐Ÿ“ˆ
  • --quiet โ€” don't be verbose. (This one overrides any earlier --verbose you used. Sorry girl, it wins.)
  • -C, --config FILE โ€” use FILE for your configuration instead of the default, /etc/slack.conf
  • -s, --source DIR โ€” the source directory for slack files
  • -e, --rsh COMMAND โ€” remote shell for rsync
  • -c, --cache DIR โ€” local cache directory for slack files
  • -t, --stage DIR โ€” local staging directory for slack files
  • -r, --root DIR โ€” root destination for slack files
  • --no-sync โ€” skips the slack-sync step. (Super useful if you're pushing stuff into the CACHE from outside of slack, iykyk)
  • --no-files โ€” don't install any files in ROOT, but do tell rsync to print what it would do. A little peek, no commitment ๐Ÿ‘€
  • --no-scripts โ€” don't run scripts
  • -n, --dry-run โ€” literally the same as --no-files --no-scripts (CACHE and STAGE will still be updated though, don't be fooled)
  • --role-list โ€” role list for slack-getroles(8)
  • -b, --backup โ€” makes backups of existing files in ROOT that get overwritten. This defaults to on unless it's set to 0 in a config file, or you disable it on the command line with --nobackup ๐Ÿ’พ
  • --backup-dir โ€” put the backups from --backup into this directory
  • -H, --hostname HOST โ€” pretend you're running on HOST instead of whatever name gethostname(2) hands you. Fake it till you make it ๐Ÿ’…
  • --preview MODE โ€” do a diff of scripts and files before running them. MODE can be simple or prompt. (More on this down in PREVIEW MODES โฌ‡๏ธ)
  • --diff PROG โ€” use this diff program for previews
  • --sleep TIME โ€” randomly sleep somewhere between 1 and TIME seconds before starting operations. Very much for crontabs, bestie ๐Ÿ˜ด

๐Ÿ”ฎ PREVIEW MODES ๐Ÿ”ฎ

Preview functionality is new in slack 0.14.0. And okay, real talk: the author hasn't quite worked out how things will work yet, so this usage is somewhat subject to change in future versions. It was very much a "let's try it this way and see how people like it" situation ๐Ÿ™ˆ

In simple mode, after syncing and staging the files directory, slack presents a diff of the files and scripts. But heads up โ€” in this mode slack will not run the preinstall or fixfiles scripts, and because of that, it may give you some false output about permission changes to files. Not a girlboss moment, just a known thing ๐Ÿซ 

In prompt mode, after syncing and staging the files directory, slack diffs the script directory. If there are differences, slack shows them to you and asks if you want to continue.

  • Say no โ†’ it exits.
  • Say yes โ†’ it stages the scripts directory, runs the preinstall and fixfiles scripts, and then diffs the files in the stage against those in the root. If there are differences, it presents them and asks if you want to continue again.
    • Say no โ†’ it exits.
    • Say yes โ†’ it installs the files and runs the postinstall script. slay ๐ŸŽ€

So basically: simple mode is easy to use, and it'll be accurate if you don't use fixfiles. prompt mode will be accurate if you use fixfiles, but it needs some interaction from you. Pick your fighter โœจ

And the question everyone asks: why can't we just have one mode that works with fixfiles and requires zero interaction?? ๐Ÿ˜ญ

Because that would require slack to understand what your free-form fixfiles executable was actually going to do โ€” which would either need some kind of universe simulator, or it would need you to write your fixfiles in a less free-form way, and that would make slack less like slack. And we are NOT doing that. ๐Ÿ’€


๐Ÿ“ EXAMPLES ๐Ÿ“

To install all the roles configured in the role list for a server:

slack

To install a specific role:

slack rolename

To test a new role before checking in the changes:

slack --source user@workstation:/home/user/.../slack rolename

To avoid killing your master server when calling from cron:

slack --sleep 3600

๐ŸŽ€ FILES ๐ŸŽ€

  • /etc/slack.conf

๐ŸŒˆ SEE ALSO ๐ŸŒˆ


okay that's the whole page bestie, go forth and autoconfigure ๐Ÿ’–

This little number lives in the Administrative commands section, dated 2004-10-22, and it's page slack(8) of your friendly neighbourhood manual ๐ŸŒธ mwah, bye! ๐Ÿ’…โœจ