You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Marcel Dopita (JIRA)" <ji...@apache.org> on 2016/12/06 11:11:36 UTC
[jira] [Commented] (CASSANDRA-10920) Let systemd know if Cassandra
is running
[ https://issues.apache.org/jira/browse/CASSANDRA-10920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15725155#comment-15725155 ]
Marcel Dopita commented on CASSANDRA-10920:
-------------------------------------------
Still an issue with datastax-ddc-3.9.0-1.noarch running on CentOS 7. Datastax docs mention compatibility with RHEL/Centos but not specific version.
I'm pinging here as there doesn't seem to be any better public place for reporting this packaging issue with Datastax rpm.
> Let systemd know if Cassandra is running
> ----------------------------------------
>
> Key: CASSANDRA-10920
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10920
> Project: Cassandra
> Issue Type: Improvement
> Components: Packaging
> Reporter: Severin Leonhardt
> Priority: Minor
> Labels: lhf
>
> Checking the status of the Cassandra service on CentOS 7 shows this:
> {noformat}
> $ systemctl status cassandra
> ● cassandra.service - SYSV: Starts and stops Cassandra
> Loaded: loaded (/etc/rc.d/init.d/cassandra)
> Active: active (exited) since Fri 2015-12-18 13:30:02 CET; 3 days ago
> Docs: man:systemd-sysv-generator(8)
> ...
> {noformat}
> The same is shown after the Cassandra process is killed or dies by itself. Notice this part: _Active: active (exited)_
> Starting Cassandra through {{systemctl start cassandra}} will not work, because systemd still thinks the service is running.
> According to the [systemd documentation regarding compatibility with SysV|http://www.freedesktop.org/wiki/Software/systemd/Incompatibilities/] this is expected behavior. Systemd doesn't know the PID of the Cassandra process and thus can't check if the service is running or not.
> It is suggested to add the following to the SysV script header comment:
> {noformat}
> # pidfile: /var/run/cassandra/cassandra.pid
> {noformat}
> After adding this manually systemd correctly detected the state of the Cassandra process on our machines.
> *Update: /var/run/cassandra is missing after reboot*
> Since CentOS 7 /var/run is a symlink to /run which is tmpfs-mounted. This makes /var/run/cassandra go away after a reboot and the PID file is never created again. (With the above change systemd even fails because it can't find the PID file.)
> I suggest adding this to make sure the directory for the PID file exists:
> {noformat}
> start)
> # Cassandra startup
> echo -n "Starting Cassandra: "
> + pid_dir=`dirname $pid_file`
> + [ -d $pid_dir ] || install -m 755 -o $CASSANDRA_OWNR -d $pid_dir
> su $CASSANDRA_OWNR -c "$CASSANDRA_PROG -p $pid_file" > $log_file 2>&1
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)