Ticket #253 (closed task: fixed)

Opened 2 years ago

Last modified 1 year ago

cannot stop fedora remotely with service fedora stop

Reported by: russ Assigned to: ronald
Priority: medium Milestone:
Component: infrastructure Version:
Keywords: startup service fedora backup Cc:
Blocking: Blocked By:

Description (Last modified by ronald)

we (would like to) run an automated backup nightly.

we need to shut down the entire stack (briefly) so that we can get a cold snapshot of fedora and mulgara before starting the backup.

we run all of the commands to stop, snapshot, start, and backup from plosnas01 over ssh. the scripts are run as the user backup, who has sudo privileges on the production servers for the appropriate commands.

when running 'service fedora start' over ssh, the server starts up just fine, however after start up it throws a log4j error, and then fails to terminate. the backup script hangs at this point waiting for the startup script to finish.

so we cannot run automated backups.

i'm guessing that the log4j error (which does not happen if you run service locally) is due to some missing environment variables, but i have no idea what.

you can reproduce this on plosfail01 by logging in as topazdev. first stop the fedora server. then say:

[topazdev@plosfail01 ~]$ ssh topazdev@localhost sudo /sbin/service fedora start
topazdev@localhost's password:
Starting Fedora
Starting the Fedora server...
Using server profile: mysql
2007-01-03 14:49:09PM PST - Waiting for startup to begin
2007-01-03 14:49:11PM PST - Starting Fedora Server instance
2007-01-03 14:49:11PM PST - Initializing Server
2007-01-03 14:49:11PM PST - Fedora Version: 2.1.1
2007-01-03 14:49:11PM PST - Fedora Build: 1
2007-01-03 14:49:11PM PST - Server Host Name: plosone-stage.plos.org
2007-01-03 14:49:11PM PST - Server Port: 9090
2007-01-03 14:49:11PM PST - Debugging: OFF
2007-01-03 14:49:11PM PST - Initializing Modules
2007-01-03 14:49:11PM PST - Post-Initializing Modules
2007-01-03 14:49:11PM PST - Initializing XACML Authorization Module
2007-01-03 14:49:13PM PST - Started
Finished.  To stop server, use fedora-stop.
log4j:WARN No appenders could be found for logger (org.topazproject.bootstrap.MasterWebAppListener).
log4j:WARN Please initialize the log4j system properly.

Dependency Graph

Change History

01/03/07 14:56:31 changed by ronald

  • status changed from new to assigned.
  • description changed.

01/05/07 18:23:59 changed by ronald

The problem is related to the fact that when you 'ssh <host> <command>' no tty is allocated (i.e. the output is not a "terminal"). The easiest fix is to use the -t option to ssh:

ssh -t topazdev@localhost sudo /sbin/service fedora ...

The log4j error occurs in both cases - it's just that when a tty is allocated then nohup redirects the output /home/topaz/nohup.out - you should find the error message in there.

01/10/07 08:33:37 changed by russ

this worked like a charm from the command line, but fedora start is still failing to return when run from cron. i'll do some research into cron and tty, perhaps there's an environment variable that needs setting in the crontab...

01/11/07 11:49:05 changed by russ

from man ssh:

-t Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful,

e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

so, i'll try -tt instead and see how that goes...

01/12/07 10:47:18 changed by russ

  • status changed from assigned to closed.
  • resolution set to fixed.

ssh -tt did the trick. thanks for your help with this ronald!

08/07/07 16:25:51 changed by

  • milestone deleted.

Milestone Bugs deleted