1

I try run clickhouse on old CPU, but get error:

Illegal instruction

Clickhouse required CPU flag SSE 4.2.

How check flags on systemd ?

Or how write this block on systemd without run bash script?

if grep -q "sse4_2" /proc/cpuinfo;
then
    /usr/bin/clickhouse-server
else
    echo "CPU doesn`t support SSE 4.2"
fi

Thank you

0

The syntax of systemd configuration files does not support bash syntax.

The best option is to place the bash script in a file, for instance "/usr/bin/clickhouse.sh".

0

The Ubuntu package comes with a clickhouse-server.service from the writers of the software itself. It does not do that test. You do that test, and if it fails do not run the commands that start or enable the service in the first place.

The clickhouse doco itself presents this as a standalone test that you do before going further, before proceeding to install the software and then run the service.

Try and build this in to the systemd service, using some sort of helper script or otherwise, and you'll end up with a service that terminates and auto-restarts continually. Note that even the old van Smoorenburg rc script that the writers of the software supply does not actually abort trying to start the service if the check fails. The exit has been commented out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.