1

I've inherited some systems that run on freebsd and inside jails. Basically the services running are old versions of qmail, spamd, dovecot, etc. None of the versions are up to date or even maintainable any more.

At present we can't move from these systems but I would at least like to be able to troubleshoot them.

My question:

Normally I would be Able to run service qmail status for example and get some info about the top level process. How do I do this inside a jail. In the case of the qmail process I can use qmailctl but what would be the equivalent for spamd or dovecot ?

also how do you go about troubleshooting these types of services the logs don't really give a very good steer on what could be going wrong.

ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
MB.
  • 145
  • 1
  • 7
  • 2
    Start with the man pages for `jls(8)` and `jexec(8)`. Use `jls` to query the name or ID number of the jail you're interested in, and then you can use `jexec` to launch a shell within that particular jail. Once you're in, it's just like managing any other qmail/spamd/dovecot installation. Also, the `service(8)` utility itself is jail-aware. [See the man page](https://www.freebsd.org/cgi/man.cgi?service(8)) and note the `-j` command line switch. – Jim L. Jan 07 '20 at 23:00

1 Answers1

0
# jls


JID  IP Address      Hostname                      Path
     1  127.0.0.2       ports12.localhost             /SPACE/jails/ports12
     2  127.0.0.3       py37jail.localhost            /SPACE/jails/py37jail

OK now I know what jails are running. I'm going to logon as root as root is understood in the ports12.localhost jail(8)

jexec -l -U root 1

root@ports12:~ #

Now that you know how to get in. You can do whatever you like, as you would normally do on the/a host system. Nearly every command is available, as would be on the Host system. When you're done. You can simply type exit, or use the key combination of ^d That is; the Ctrl+d keys. See also: jexec(8), jls(8), and jail.conf(5)

somebody
  • 343
  • 1
  • 6