new(scrips): improve systemd units for rpm and debian.#2242
Conversation
scripts/debian/postinst.in
Outdated
| if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then | ||
| # This will only remove masks created by d-s-h on package removal. | ||
| deb-systemd-helper unmask 'falco.service' >/dev/null || true | ||
| deb-systemd-helper unmask 'falco@kmod.target' >/dev/null || true |
There was a problem hiding this comment.
By default, enable falco on kmod, just like we did before.
| Description=Falco: Container Native Runtime Security with ebpf | ||
| Documentation=https://falco.org/docs/ | ||
| PartOf=falco@ebpf.target | ||
| Conflicts=falco-kmod.service |
There was a problem hiding this comment.
If you enable falco@ebpf.target it will automatically disable falco@kmod.target.
There was a problem hiding this comment.
The same is true for the other way round.
| @@ -0,0 +1,11 @@ | |||
| [Unit] | |||
There was a problem hiding this comment.
Small service that manages kmod injection.
|
/milestone 0.34.0 |
|
This is really cool! EDIT: the below is not possible; see later comment: #2242 (comment) With regards to taking advantage of the templating aspect of this change, can we move more options over to The following block of configuration options are shared between the two files: At the moment, the only option unique to |
Are they inherited? I didn't know that! |
I'm actually not sure; let me read more into it and see if that's the case 👀 |
|
I've read a little more in https://www.freedesktop.org/software/systemd/man/systemd.unit.html and https://askubuntu.com/questions/659267/how-do-i-override-or-configure-systemd-services/659268#659268; systemd unit template file options are not inherited. Seems like the unit template serves for parameterizing the service and grabbing specifiers; in other words, templating for the service itself and not templating for writing other service unit definitions. |
:( It could be a very nice cleanup! |
4884917 to
552872f
Compare
|
Rebased on top of master.
|
|
An aside -- I mentioned somewhere that I loaded the BPF probe/ started the Falco process differently: This is due to my team and I creating falco-bpf probe packages alongside new kernel releases and having a naming format that's not the same as the Falco format. As far as I know, there wasn't a flexible way in a systemd unit to dynamically grab a variable value. |
238eaf7 to
a1f0e5f
Compare
|
TODO:
|
a0d40ba to
42986b4
Compare
|
Renamed "Don't start" option to "Plugins" and rebased :) |
f2af848 to
97fd0c3
Compare
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
…d-inject with `PartOf`. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
…ical size to comprehend all of 5 options. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it> Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Co-authored-by: Andrea Terzolo <andrea.terzolo@polito.it> Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
098dbe5 to
2f21814
Compare
|
New changes are detected. LGTM label has been removed. |
|
Rebased + added small fix. |
|
Hey @FedeDP I was able to pull down this branch today and play around with it. Here is some output I was playing around with: However, I was unable to start/enable the service as described in the description with Just wanted to double check and ask if this was working as expected? |
Yep it is expected since there is no more a |
|
@happy-dude i updated the OP! |
leogr
left a comment
There was a problem hiding this comment.
I believe this PR has finally reached a very great status and is ready to be tested in the real world.
🥳
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, jasondellaluce, leogr The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
What this PR does / why we need it:
Unify systemd units for debian and rpm; plus, rework them to support eBPF, plugins and modern eBPF too.
One will be able to enable falco with eg: bpf by running:
Moreover, since services conflicts with each other, running
while
falco-bpf.serviceis active, will bring down bpf one, in favor of the kmod one.Example dialog:

Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: