Mailing List Archive

Disabling job control in bash
Hi all,

I need to disable job control on a machine with 650+ users because way too
many of them believe that Ctrl-Z is how you kill processes. So, I want Ctrl-Z
to basically do nothing. I've found a great solution:

set +m

on the command line this enables monitor mode, disables job control and makes
sure that Ctrl-Z does nothing. It's a perfect solution, as of these 650+
users, at least 200 are experienced on Unix and can be trusted. If they
decide to use zsh, or run 'set -m' or undo this setting in their profile,
then they obviously know enough to be trusted and equally obviously know how
to use job control. They can then do that with my complete blessing.

But 'set +m' does not have the intended effect in the shell start up files
(*profile) and bash does not seem to have a command line switch to enable it.
Does anyone know how to get the effect of set +m when bash starts?

alan

p.s. various other solutions have been tried such as recompiling bash and
putting the original outside the regular PATH, disabling the Ctrl-Z keystroke
entirely, and using a restricted shell. None of these are suitable, I've
already tried and they cause insane amounts of toruble for valid users. 'set
+m' is exactly what I want, I just need to get it to work :-)

--
alan dot mckinnon at gmail dot com
Re: Disabling job control in bash [ In reply to ]
Alan McKinnon <alan.mckinnon@gmail.com> writes:

> Hi all,
>
> I need to disable job control on a machine with 650+ users because way
> too many of them believe that Ctrl-Z is how you kill processes. So, I
> want Ctrl-Z to basically do nothing. I've found a great solution:
>
> set +m

One other way could perhaps be to tell the terminal not to send suspend
on Ctrl-Z keypress

stty susp undef

--
Christer
Re: Re: Disabling job control in bash [ In reply to ]
On Monday 10 November 2008 02:39:47 Christer Ekholm wrote:
> Alan McKinnon <alan.mckinnon@gmail.com> writes:
> > Hi all,
> >
> > I need to disable job control on a machine with 650+ users because way
> > too many of them believe that Ctrl-Z is how you kill processes. So, I
> > want Ctrl-Z to basically do nothing. I've found a great solution:
> >
> > set +m
>
> One other way could perhaps be to tell the terminal not to send suspend
> on Ctrl-Z keypress
>
> stty susp undef

Contrary to my expectations, this suggestion worked a treat :-)

I'd explored stty previously - unfortunately I don't remember the exact
invocations I used - and wasn't happy with the outcome.

Thanks for the tip!

--
alan dot mckinnon at gmail dot com