New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PID is not saved to pidfile if startup has issues (v2.0.0-alpha5), so can't stop/status process. #1969

Closed
gitfrederic opened this Issue Mar 24, 2016 · 0 comments

Comments

Projects
None yet
3 participants
@gitfrederic
Contributor

gitfrederic commented Mar 24, 2016

When using the -p option on the graylog server, e.g.:

... -jar ..../graylog.jar server -f ..../graylog.conf -p .../graylog.pid

The graylog.pid file won't exist if there are start-up problems (see log example below). With SysV or systemd control scripts that look for the PID file to perform stop or status, this causes problems. Even graylogctl would have issues, e.g.:

stop() {
    if [ ! -f "${GRAYLOG_PID}" ]; then
      die "Not stopping. PID file not found: ${GRAYLOG_PID}"
    fi
...

This is likely due to 'startCommand()' being called fairly late at https://github.com/Graylog2/graylog2-server/blob/2.0.0-alpha.5/graylog2-server/src/main/java/org/graylog2/bootstrap/CmdLineTool.java#L196 (where the PID is then written to disk).

From graylog-server log:

2016-03-24 00:44:31,549 INFO : org.graylog2.bootstrap.ServerBootstrap - Graylog server 2.0.0-alpha.5 (bb2e3ef) starting up
2016-03-24 00:44:31,549 INFO : org.graylog2.bootstrap.ServerBootstrap - JRE: Oracle Corporation 1.8.0_72 on Linux 3.10.0-123.el7.x86_64
2016-03-24 00:44:31,549 INFO : org.graylog2.bootstrap.ServerBootstrap - Deployment: unknown
2016-03-24 00:44:31,549 INFO : org.graylog2.bootstrap.ServerBootstrap - OS: CentOS Linux 7 (Core) (centos)
2016-03-24 00:44:31,550 INFO : org.graylog2.bootstrap.ServerBootstrap - Arch: amd64
2016-03-24 00:44:31,588 INFO : org.graylog2.shared.initializers.PeriodicalsService - Starting 20 periodicals ...
2016-03-24 00:44:31,588 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.ThroughputCalculator] periodical in [0s], polling every [1s].
2016-03-24 00:44:31,589 INFO : org.elasticsearch.node - [graylog-46c224f5-f271-46e3-8b9b-cc8e55552969] starting ...
2016-03-24 00:44:31,594 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.AlertScannerThread] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,594 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.BatchedElasticSearchOutputFlushThread] periodical in [0s], polling every [1s].
2016-03-24 00:44:31,598 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.ClusterHealthCheckThread] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,598 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.ContentPackLoaderPeriodical] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,598 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.GarbageCollectionWarningThread] periodical, running forever.
2016-03-24 00:44:31,599 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.IndexerClusterCheckerThread] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,600 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.IndexRetentionThread] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,600 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.IndexRotationThread] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,600 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.NodePingThread] periodical in [0s], polling every [1s].
2016-03-24 00:44:31,601 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.VersionCheckThread] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,601 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.periodical.ThrottleStateUpdaterThread] periodical in [1s], polling every [1s].
2016-03-24 00:44:31,601 INFO : org.graylog2.periodical.Periodicals - Starting [org.graylog2.events.ClusterEventPeriodical] periodical in [0s], polling every [1s].
2016-03-24 00:44:31,603 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.events.ClusterEventCleanupPeriodical] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,604 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.ClusterIdGeneratorPeriodical] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,604 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.IndexRangesMigrationPeriodical] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,604 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.IndexRangesCleanupPeriodical] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,604 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.UserPermissionMigrationPeriodical] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,604 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.AlarmCallbacksMigrationPeriodical] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,604 INFO : org.graylog2.shared.initializers.PeriodicalsService - Not starting [org.graylog2.periodical.ConfigurationManagementPeriodical] periodical. Only started on Graylog master nodes.
2016-03-24 00:44:31,830 ERROR: com.google.common.util.concurrent.ServiceManager - Service IndexerSetupService [FAILED] has failed in the STARTING state.
...

NOTE: The start-up problems here are likely due to ElasticSearch (but that shouldn't be relevant).

Graylog server 2.0.0-alpha.5 (bb2e3ef) starting up
JRE: Oracle Corporation 1.8.0_72 on Linux 3.10.0-123.el7.x86_64
OS: CentOS Linux 7 (Core) (centos)
Arch: amd64

@kroepke kroepke added bug S3 P3 labels Mar 24, 2016

@kroepke kroepke added this to the 2.0.0 milestone Mar 24, 2016

joschi added a commit that referenced this issue Mar 24, 2016

@joschi joschi self-assigned this Mar 24, 2016

@bernd bernd closed this in #1978 Mar 29, 2016

@kroepke kroepke added the triaged label Sep 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment