fireplace icon indicating copy to clipboard operation
fireplace copied to clipboard

Using without systemd

Open ararslan opened this issue 7 years ago • 8 comments

Hi there! I'm quite excited about the prospect of using Fireplace on FreeBSD. However, currently it depends on the systemd crate, and systemd is very notably not a FreeBSD thing. I realize that Fireplace is currently unmaintained as development is focused on Smithay, but once the backend here is migrated to Smithay, will it be possible to avoid using systemd?

ararslan avatar Dec 09 '17 20:12 ararslan

FYI The requirement for systemd is due to the use of logind to request resources for the compositor at startup time. I could have sworn wlc supports non-logind login using suid bits on the binary (and thus current Fireplace shouldn't require systemd), but maybe fireplace does something else with systemd I'm not aware of?

Either way, Smithay will need support similar to what wlc does for getting those resources. If that isn't on their roadmap you should see how wlc does it and try to submit a patch once they have their session handling fleshed out more.

Timidger avatar Dec 09 '17 22:12 Timidger

It doesn't appear to be declared as a dependency of Fireplace in Cargo.toml, so I guess it must be a dependency of a dependency?

To elaborate a bit on the initial issue, building Fireplace fails when it tries to build the systemd crate. Why it's trying to build that in the first place I'm not certain, but for reference I'm getting

error: failed to run custom build command for `libsystemd-sys v0.0.10`
process didn't exit successfully: `/usr/home/alex/fireplace/target/release/build/libsystemd-sys-f46375297bf4c6ef/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'systemd was not found via pkg-config nor via the env var LIBSYSTEMD_FLAGS', /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/libsystemd-sys-0.0.10/build.rs:17
note: Run with `RUST_BACKTRACE=1` for a backtrace.

It may also be useful to note that systemd is listed as optional in the README, so I'm surprised this is an issue.

ararslan avatar Dec 10 '17 00:12 ararslan

It looks like it comes from its dependency on journald logging via the slog-journald crate. That should be made optional using a feature flag / disabled automatically for non-linux builds.

Timidger avatar Dec 10 '17 00:12 Timidger

Also, it's important for Gentoo Linux users because by default we are using OpenRC and ConsoleKit2.

stalkerg avatar Dec 10 '17 01:12 stalkerg

@ararslan I have no idea how well any of this will work on FreeBSD, but I am absolutely willing to accept patches.

Smithay will not require systemd, the goal is to offer multiple options, including the legacy tty/vt sessions and ConsoleKit.

Also @Timidger is right, journald support should of course also be optional. After moving over to smithay I will make sure systemd is not necessarily in the dependency tree.

Drakulix avatar Dec 10 '17 18:12 Drakulix

Okay, awesome. When I get some time I'll try to put together a patch that sticks the journald stuff behind a cfg(target_os = "linux"), unless you'd prefer it be an opt-in feature or something like that.

ararslan avatar Dec 10 '17 19:12 ararslan

No need to patch the old codebase. also this will clearly be a opt-in feature, there are enough linux users not using systemd to justify that.

Drakulix avatar Dec 10 '17 19:12 Drakulix

@ararslan I think, depending on OS type it is a bad idea. syslog-ng it's still popular. (and default on Gentoo)

stalkerg avatar Dec 11 '17 00:12 stalkerg