0

In linux I would use the disown command to disconnect a backgrounded process from my terminal so when I quit the terminal or disconnected from it, the job would continue as a child of the init process. In the ESXi /bin/sh shell, I see no disown command. How can I disown a running process in the shell of an esxi host? Using ssh to connect.

  • 2
    What's your use case here? You should really not be running any long-running processes in the ESXi console. – EEAA Oct 30 '13 at 22:02
2

ESXi uses a limited console based on a customized version of Busybox and only features a subset of the tools you'd see in a traditional Linux installation. It's a single executable with multiple hard-links to the main binary.

You should not be running any "jobs" on the ESXi console. Why do you require this functionality?

  • Say I started a vmkfstools disk clone via ssh, and it was running after I needed to leave the office and take my laptop, thus disconnecting from the ssh session. It would be nice to disown that process. If I had known it was going to run so long, I could have nohupped it, but I didn't. Doesn't seem like too much to ask. – user160910 Oct 31 '13 at 13:33
  • You don't have access to Virtual Center? – ewwhite Oct 31 '13 at 13:42
  • 1
    Lots of small setups don't use Virtual Center. Hey, guess what I'm doing later today? Migrating some machines off ESXi by hand... somehow. – MikeyB Oct 31 '13 at 13:47
  • @MikeyB VMWare Converter. – Nathan C Oct 31 '13 at 13:51
  • The vCenter barrier isn't particularly high, even for small standalone systems (The Essentials package is ~$500US). But if you're at the point where you're cloning VMDKs with vmkfstools commands, it may make sense to have access to a Virtual Center. Migration of VMs from standalone hosts can be handled by vCenter Converter or just an .ovf export, though. – ewwhite Oct 31 '13 at 13:51
1

This does work on ESXi 6.0:

exec </dev/null >/dev/null 2>/dev/null

This command explicitly closes stdin, stdout and stderr file descriptors, which will terminate your shell and SSH session, but e.g. leave a background file copy running.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy