Mono(mono-service)

πŸ“¦
version 6.14.1 Β· 2 versions
, in alpine 3.24, epel 10, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– mono-service β€” Mono(mono-service) πŸ’–

okay bestie, sit down, grab a boba, because we're talking about the Mono ServiceProcess host and honestly? it's giving backend royalty. πŸ‘‘


✨ NAME ✨

mono-service, mono-service2 β€” the Mono ServiceProcess host, aka the little program that lets your service live its truth in the background. 🫢


🌸 SYNOPSIS 🌸

mono-service [options] program.exe

πŸ¦‹ DESCRIPTION πŸ¦‹

So. mono-service is a host β€” it's the thing that runs services built with the ServiceProcess assembly. It's not the service itself, it's the stage the service performs on. main character energy, but for a daemon. πŸ’…

Which one do you use? Depends on your assembly vibe:

  • Use mono-service to run services that use the 1.0 assemblies.
  • Use mono-service2 to run services that use the 2.0 assemblies.

Now, the control situation. You talk to your service with signals, and she WILL listen:

  • Send the SIGUSR1 signal to the process β†’ the service gets paused ⏸️
  • Send the SIGUSR2 signal β†’ execution resumes ▢️
  • Send the SIGTERM signal β†’ the service shuts down cleanly 🧼✨

The following options can be used to control the service:

  • -d:DIRECTORY β€” use this to set the working directory for the service. the default is the current directory. 🏠
  • -l:LOCKFILE β€” specifies the file to use for locking. the default is a filename constructed in /tmp based on the name of the program that hosts the service. πŸ”’
  • -m:MESSAGE β€” the name to show in the syslog. πŸ“
  • -n:NAME β€” use this to specify which service to launch (in case your program contains more than one service). the default is to run the first defined service. πŸ₯‡
  • --debug β€” use this to stop mono-service from redirecting stdin and stdout, and to prevent the program from being sent to the background. Equivalent to --no-daemon. πŸ›
  • --no-daemon β€” use this to stop mono-service from redirecting stdin and stdout, and to prevent the program from being sent to the background. Equivalent to --debug. πŸ›
ngl the --debug / --no-daemon duo is literally the same thing twice and that's iconic of them honestly πŸ’€

πŸŽ€ CONTROL πŸŽ€

You can control the service by sending signals to the process. here are the commands, bestie:

Pausing service:

kill -USR1 `cat <lock file>`

Resuming service:

kill -USR2 `cat <lock file>`

Stopping the service:

kill `cat <lock file>`
the backticks matter!! cat <lock file> is reading your lock file to get the PID, and the kill is doing the actual slaying. don't skip the backticks or you'll be yelling at a file that doesn't exist. 😭

🌈 EXAMPLES 🌈

Start the MyService.exe assembly, with a lock in /root/service-lock:

mono-service -l:/root/service-lock MyService.exe

look at her go. so clean, so simple. obsessed. ✨


πŸ” DEBUGGING πŸ”

Messages produced by the service are logged on syslog. that's it, that's the whole section β€” go check your syslog. πŸ“‹


πŸ’Œ MAILING LISTS πŸ’Œ

Want to talk to the mono people? Visit http://lists.ximian.com/mailman/listinfo/mono-list for details. πŸ“¬


🌐 WEB SITE 🌐

Visit: http://www.mono-project.com for details. πŸ•ΈοΈ


πŸ‘€ SEE ALSO πŸ‘€


that's the whole page, bestie β€” every flag, every signal, every command, untouched, just with ✨flavor✨. fr fr, no cap. πŸ’œ

and that's a wrap on this Mono(mono-service) manual page β€” same manual name as up top, same footer energy down here. go run some services, you absolute legend. πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from