Commit Graph

12 Commits

Author SHA1 Message Date
Azat Khuzhin
1fe8076b94 Fix capabilities installed via systemd service (fixes netlink/IO priorities)
CapabilityBoundingSet that contained in systemd unit before is about
allowing to set some capabilities, not about granting them.

To grant them you need to use AmbientCapabilities.

And if you do not use 'clickhouse install' then:
- IO priorities was unavailable (since they requires CAP_SYS_NICE)
- For taskstats the procfs was used instead of netlink

Not a big deal, but still.

Here how it had been tested:

    $ systemd-run -p CapabilityBoundingSet=CAP_NET_ADMIN --shell
    root:/etc (master)# capsh --print
    Current: cap_net_admin=ep
    Bounding set =cap_net_admin
    Ambient set =

    $ systemd-run -p User=azat -p CapabilityBoundingSet=CAP_NET_ADMIN --shell
    azat:/etc$ capsh --print
    Current: =
    Bounding set =cap_net_admin
    Ambient set =

    $ systemd-run -p User=azat -p AmbientCapabilities=CAP_NET_ADMIN -p CapabilityBoundingSet=CAP_NET_ADMIN --shell
    azat:/etc$ capsh --print
    Current: cap_net_admin=eip
    Bounding set =cap_net_admin
    Ambient set =cap_net_admin

Note, if you are running it under root (without changing user) you don't
need to specify AmbientCapabilities additionally, because root has all
capabilities by default and they had been inherited.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-21 13:57:31 +02:00
Thomas Casteleyn
b8d2432296
Fix startup on older systemd versions
Fixes #47293
2023-03-17 17:56:56 +01:00
Palash Goel
3615c6f4fb
Fix typo in service definition 2023-03-01 10:37:21 +05:30
Mikhail f. Shiryaev
cf067c1b67
Use /etc/default/clickhouse in systemd too 2023-02-28 12:00:08 +01:00
Azat Khuzhin
19d0c929d6 Disable timeout logic for starting clickhouse-server from systemd service
After ClickHouse became systemd aware (#43400), it waits not more then
TimeoutStartSec (1m30sec by default), while before it simply ensures
that the process is there.

And likely 1m30sec can be not enough for some cluster, and this will
lead to endless restarts.

At first I've increased it to 10min, but there was a comment about that
this is not enough, and I agree with this.

But I'm not sure that using "inifinity" is a good option, but I cannot
think of any downsides of this.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-21 10:08:15 +01:00
cmsxbc
1ad9e217e5 chore: remove starting blank 2023-02-16 19:24:46 +08:00
SuperDJY
7de008a58a Fix systemd service file wrong inline comment
There is no inline comment in systemd unit file.
2023-02-16 19:24:46 +08:00
Mikhail f. Shiryaev
548b89b7e0
Use systemd %-specifiers in clickhouse-server.service 2023-02-03 12:16:16 +01:00
Alexander Gololobov
688e6fe714 Send MAINPID= notification from the parent (watchdog) process to make systemd handle READY=1 notifiaction from the child 2022-12-05 23:03:40 +01:00
Коренберг ☢️ Марк
6dbeee69d6 Fix ##8685 - added systemd sd_notify implementation 2022-11-20 19:34:12 +02:00
Denny Crane
4debd3b609 fix service start with systemd 2022-04-02 19:26:41 -03:00
Mikhail f. Shiryaev
342f7ba567
Migrate to nfpm 2022-03-22 11:09:59 +01:00