socketwatch(1)

πŸ“¦ version 2018-11, in nixos 26.05, nixpkgs unstable

πŸ’… socketwatch(1) β€” General Commands Manual, bestie

okay so picture this: it's the General Commands Manual, and the star of the show is socketwatch β€” a watchdog for network activity. she's giving supervisor energy and honestly? iconic. let's get into it 🫢


✨ NAME ✨

socketwatch β€” run a command under a watchdog for network activity πŸ‘€


🌸 SYNOPSIS 🌸

socketwatch [options] <command> [arguments ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so socketwatch runs a command for you and then watches it β€” specifically it monitors its network activity, and it does that via an LD_PRELOAD library (yes, that's the whole trick, she's sneaky like that πŸ’…). and if the command doesn't send or receive any network data for a stretch of time longer than the timeout value? socketwatch kills it. periodt. πŸ’€

socketwatch exits when the command it started exits. and if socketwatch was the one that killed the command, then socketwatch exits with an error. otherwise β€” and this is the cute part β€” socketwatch exits with the command's own exit status. fr fr, she passes it right along 🌈

and now the important one, bestie, don't skip this: the argument -- disables argument parsing for all proceeding arguments. like, for example, socketwatch ls -l will pass -l to socketwatch and run ls, whereas socketwatch -- ls -l will run ls -l. see the difference?? that -- is doing so much work πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

  • -t, --timeout β€” Set the network activity timeout. ⏰ (this is literally the whole personality of the watchdog)
  • -V, --version β€” Display version information. πŸ’–
  • -?, --help β€” Display a summary of command-line options. πŸ₯Ί asking for help is self care

πŸ’€ LIMITATIONS πŸ’€

okay, now the fine print β€” and ngl this part matters, so read it, don't scroll past πŸ™ˆ

  • socketwatch detects network activity only for file descriptors created within the command process and through socket(2).
  • socketwatch detects network activity from only a limited subset of system calls: read(2) and write(2).
  • socketwatch monitors only dynamically-linked system calls.
  • socketwatch does not allow the command to fork or create threads.
lowkey the last one is the big vibe check: no forking, no threads, that's just how it is 😭

πŸ”₯ SEE ALSO πŸ”₯

socketwatch is part of mswatch(1); mswatch website: http://mswatch.sf.net/ β€” go say hi to the family 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Written by Chris Frost <chris@frostnet.net>. πŸ“


and that's the whole page, bestie ✨ this was socketwatch(1) from the General Commands Manual β€” mwah, go watch some sockets, stay hydrated, and remember: no network activity for too long and she will end you πŸ”₯πŸ’œ

πŸ“¦ where this page comes from