Giter VIP home page Giter VIP logo

systemd-service2run's Introduction

systemd-service2run

A simple python script that can take a systemd service and outputs a systemd-run invocation that should give you an interactive shell that reflects environment the service would run in.

Motivation

I was working on setting up some systemd services on nixos and in trying to implement the principles of least separation I kept running into permissions issues. I wanted to debug those services, and an interactive shell that reflected the permissions of the service seemed perfect.

I learnt of systemd-run in this blog post from Lennart Poettering. He has a lot of systemd-run invocations in that post, but on nixos the paths to executables, and packages is far too long, and I didn't want to copy paste these in a terminal.

I couldn't find anything within systemd to take a service's unit file, and run a shell for it, so I wrote this. It's almost certainly incomplete, and there are probably a lot of features of the unit file spec that are missing from this script. Feel free to contribute to this script if something you know want is missing.

If this can be done within systemd-itself, please let me know.

systemd-service2run's People

Stargazers

Burner avatar

Watchers

Varun Madiath avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.