[ 
https://issues.apache.org/jira/browse/CASSANDRA-15273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17033660#comment-17033660
 ] 

Jürgen Albersdorfer commented on CASSANDRA-15273:
-------------------------------------------------

As a followup to [~musinsky] and as an Answer for [~acerna], I fixed both 
{{start}} and {{stop}} as following:
{noformat}
--- /etc/rc.d/init.d/cassandra.old       2020-02-10 15:23:38.852120933 +0100
+++ /etc/rc.d/init.d/cassandra.new       2020-02-10 15:23:10.610076622 +0100
@@ -71,7 +71,9 @@
        chown -R cassandra:cassandra "$(dirname "$log_file")"
         [ -d `dirname "$pid_file"` ] || \
             install -m 755 -o $CASSANDRA_OWNR -g $CASSANDRA_OWNR -d `dirname 
$pid_file`
-        su $CASSANDRA_OWNR -c "$CASSANDRA_PROG -p $pid_file" > $log_file 2>&1
+        # su $CASSANDRA_OWNR -c "$CASSANDRA_PROG -p $pid_file" > $log_file 2>&1
+        runuser -u $CASSANDRA_OWNR -- $CASSANDRA_PROG -p $pid_file > $log_file 
2>&1
+        chown root.root $pid_file
         retval=$?
         [ $retval -eq 0 ] && touch $lock_file
         echo "OK"
@@ -79,7 +81,8 @@
     stop)
         # Cassandra shutdown
         echo -n "Shutdown Cassandra: "
-        su $CASSANDRA_OWNR -c "kill `cat $pid_file`"
+        # su $CASSANDRA_OWNR -c "kill `cat $pid_file`"
+        runuser -u $CASSANDRA_OWNR -- kill `cat $pid_file`
         retval=$?
         [ $retval -eq 0 ] && rm -f $lock_file
         for t in `seq 40`; do
{noformat}

> cassandra does not start with new systemd version
> -------------------------------------------------
>
>                 Key: CASSANDRA-15273
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15273
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Aleksandr Yatskin
>            Priority: Urgent
>
> After update systemd with  fixed vulnerability 
> https://access.redhat.com/security/cve/cve-2018-16888, the cassandra service 
> does not start correctly.
> Environment: RHEL 7, systemd-219-67.el7_7.1, cassandra-3.11.4-1 
> (https://www.apache.org/dist/cassandra/redhat/311x/cassandra-3.11.4-1.noarch.rpm)
> ---------------------------------------------------------------
> systemctl status cassandra
> ● cassandra.service - LSB: distributed storage system for structured data
>  Loaded: loaded (/etc/rc.d/init.d/cassandra; bad; vendor preset: disabled)
>  Active: failed (Result: resources) since Fri 2019-08-09 17:20:26 MSK; 1s ago
>  Docs: man:systemd-sysv-generator(8)
>  Process: 2414 ExecStop=/etc/rc.d/init.d/cassandra stop (code=exited, 
> status=0/SUCCESS)
>  Process: 2463 ExecStart=/etc/rc.d/init.d/cassandra start (code=exited, 
> status=0/SUCCESS)
>  Main PID: 1884 (code=exited, status=143)
> Aug 09 17:20:23 desktop43.example.com systemd[1]: Unit cassandra.service 
> entered failed state.
> Aug 09 17:20:23 desktop43.example.com systemd[1]: cassandra.service failed.
> Aug 09 17:20:23 desktop43.example.com systemd[1]: Starting LSB: distributed 
> storage system for structured data...
> Aug 09 17:20:23 desktop43.example.com su[2473]: (to cassandra) root on none
> Aug 09 17:20:26 desktop43.example.com cassandra[2463]: Starting Cassandra: OK
> Aug 09 17:20:26 desktop43.example.com systemd[1]: New main PID 2545 does not 
> belong to service, and PID file is not owned by root. Refusing.
> Aug 09 17:20:26 desktop43.example.com systemd[1]: New main PID 2545 does not 
> belong to service, and PID file is not owned by root. Refusing.
> Aug 09 17:20:26 desktop43.example.com systemd[1]: Failed to start LSB: 
> distributed storage system for structured data.
> Aug 09 17:20:26 desktop43.example.com systemd[1]: Unit cassandra.service 
> entered failed state.
> Aug 09 17:20:26 desktop43.example.com systemd[1]: cassandra.service failed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to