PHPackages                             mjanser/systemctl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mjanser/systemctl

Abandoned → [icanhazstring/systemctl-php](/?search=icanhazstring%2Fsystemctl-php)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

mjanser/systemctl
=================

Library for managing systemd services using systemctl

86572[1 PRs](https://github.com/mjanser/php-systemctl/pulls)PHP

Since Feb 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mjanser/php-systemctl)[ Packagist](https://packagist.org/packages/mjanser/systemctl)[ RSS](/packages/mjanser-systemctl/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

SystemCtl for PHP
=================

[](#systemctl-for-php)

[![Build Status](https://camo.githubusercontent.com/b963a8333808536bcc8f4dd499adb9f9aa78282e627125bce7a8f740436cd698/68747470733a2f2f7472617669732d63692e6f72672f6d6a616e7365722f7068702d73797374656d63746c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mjanser/php-systemctl)[![Code Coverage](https://camo.githubusercontent.com/b839af97cb0a12dfe401a2ff05801cd33405ef52aad6e79e3f62f6b51d80b758/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6a616e7365722f7068702d73797374656d63746c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mjanser/php-systemctl/?branch=master)

This library can be used to manage systemd services. Internally it uses the [Symfony Process Component](https://symfony.com/doc/current/components/process.html) for running the `systemctl` command.

Requirements
------------

[](#requirements)

- PHP 7.0 or higher
- `systemd` installed

Installation
------------

[](#installation)

Run the following composer command in your project:

```
composer require mjanser/systemctl
```

Usage
-----

[](#usage)

Example usage:

```
$service = new SystemCtl\Service('my-service');

if ($service->isRunning()) {
    $service->stop();
} else {
    $service->start();
}

$service->restart();
```

By default the command `systemctl` will be executed with `sudo`. You can change that if you need.

```
SystemCtl\Service::setCommand('my-systemctl');
SystemCtl\Service::sudo(false);
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1826722?v=4)[Martin Janser](/maintainers/mjanser)[@mjanser](https://github.com/mjanser)

---

Top Contributors

[![mjanser](https://avatars.githubusercontent.com/u/1826722?v=4)](https://github.com/mjanser "mjanser (14 commits)")

---

Tags

phpsystemctlsystemd

### Embed Badge

![Health badge](/badges/mjanser-systemctl/health.svg)

```
[![Health](https://phpackages.com/badges/mjanser-systemctl/health.svg)](https://phpackages.com/packages/mjanser-systemctl)
```

###  Alternatives

[league/glide-symfony

Glide adapter for Symfony

1046.0M36](/packages/league-glide-symfony)[zaininnari/html-minifier

The Blink HTMLTokenizer ported to PHP.

62407.9k8](/packages/zaininnari-html-minifier)[elgentos/magento2-structured-data

Implement structured data for Magento 2 webshops.

1446.3k](/packages/elgentos-magento2-structured-data)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
