How to send to background a running process started with sudo

background-processsudoterminal

I have just installed SLC6 (derived from SL6 derived from RHEL6). I can send a running process to the background by hitting Ctrl-Z in the terminal where it was started. However, I can't do it when I started the command with sudo. It used to work seamlessly in SLC5.

Is there any configuration I could do to allow this ?

EDIT
This is an example of command I try to run :

[user@pcald02 ~]$ sudo emacs
^Z^C

The Ctrl-Z makes the symbols ^Z appear but nothing else happens. Now I realized that even Ctrl-C is ineffective.

Without sudo :

[user@pcald02 ~]$ emacs
^Z
[1]+  Stopped                 emacs
[user@pcald02 ~]$ 

Best Answer

I'm guessing the real problem here is that the command you are trying to run is Emacs. Running Emacs as root is hardly ever a good idea. Emacs also overrides a number of keystrokes, so C-z might not work simply for that reason. If root is already logged in, emacs might start graphically on root's display. Etc, etc.

Look at using the sudo: method from Tramp for editing files using sudo from Emacs. For example, to edit /etc/motd, do C-x C-f and type the path as /sudo:root@localhost:/etc/motd.

Related Question