[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Temporaly disable program

On 16-May-99 Urban Gabor wrote:
> Hi,
> I've installed a program (gpm to more precise) and I want to
> disable/enable it for the next booting. Remove/install every time I
> want to experiment would be weird. Any ideas are wellcome

Generically, the way to prevent a program from executing is to change its
permissions so that it is not executable (i.e. does not have "x"

My gpm has (ls -l `which gpm`):
-rwxr-xr-x   1 root     root        36515 Dec  1  1997 /usr/bin/gpm

i.e. "755" permissions. If you do

  chmod 644 /usr/bin/gpm

then the result would be

-rw-r--r--   1 root     root        36515 Dec  1  1997 /usr/bin/gpm

i.e. the "x" permissions would have gone and the program would not
execute. When you want it back, you restore them with

  chmod 755 /usr/bin/gpm

I'm not running a Debian system at the moment, so I can't answer for
precisely how Debian starts up gpm when it boots, but in my SuSE system
the file  /etc/rc.d/init.d/gpm  has the lines

test "$START_GPM" = yes || exit 0

case "$1" in
        if test -x /usr/bin/gpm ; then
                echo "Starting console mouse support. (gpm)"
                /usr/bin/gpm $GPM_PARAM &

The "if test ... " checks whether /usr/bin/gpm exists and is executable.
If not (which would be the case if you changes the permissions) then
nothing is done. For what you want to do, achieving it simply by
changing permissions is going to be simpler than fiddling deep inside
the boot-up initialisation scripts.

Hope this helps,

E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk>
Date: 16-May-99                                       Time: 10:34:17
------------------------------ XFMail ------------------------------

Reply to: