linux - 系统 session 低于用户 session

标签 linux development-environment systemd

是否可以在用户 session 下运行 systemd session ,单元文件位于子目录中且未安装在 ~/.config/systemd 中?我正在开发一个由不同服务(用 C++ 实现)组成的系统,其中一些服务相互依赖。目前,它们从 bash 脚本运行并全部写入标准输出。我希望能够从构建目录启动它们,例如

# enter build directory
cd /path/to/project/build
# start services
systemd --root ./systemd-units &
# check status of services
systemctl --root ./systemd-units status
# check log output of services
journalctl --root ./systemd-units

不幸的是,不存在这样的选项,我也找不到任何替代方案。我不想使用 docker,因为它会使调试变得不必要的困难。

有没有办法用 systemd 做我想做的事?我调查了其他系统和runit似乎能够做我想做的事,但不太可能在最终产品中使用。

最佳答案

听起来您可能想要使用 link systemctl 的特性,因此您可以将不是搜索路径的单元链接到搜索路径中。

关于linux - 系统 session 低于用户 session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52539574/

相关文章:

linux - 为什么 BIOS 不直接加载 Linux 内核 - 为什么是 MBR 和所有那些麻烦?

linux - 用于 eclipse-mars 及更高版本的 Buildroot 插件

git - 电子表格宏的版本控制

linux - 在 Docker 容器中以主机用户身份运行

git - 当开发尚未稳定时将错误修复推送到生产中

python - 按顺序重新加载 systemd/gunicorn/flask 工作线程以进行配置更改

python - Systemd - Python 脚本主进程退出,code=exited,status=1/FAILURE

linux - 使用 (g)awk 使用日期和时间部分插入基于列的数据

Python 的守护进程 PPID 不等于 1

linux - 与 Xmonad 一起使用时 Xmobar 不可见