/g-systemctl

graphical systemctl to manage services

Primary LanguageGo

G-Systemctl

g-systemctl is a graphical user interface for your services in *nix systems. you can see all of your service deamons and search, filter them.

Screenshot from 2023-10-15 23-51-45

Table of Contents

Prerequisites

  • Go (Golang): Install Go
  • A web browser for frontend testing

Installation

  1. Clone the repository:

    git clone https://github.com/shakg/g-systemctl.git
    cd g-systemctl
  2. Build the project:

    go build src/server.go

One Line Relase Download

curl https://api.github.com/repos/shakg/g-systemctl/releases/latest |jq '.assets[0].browser_download_url' | xargs wget

Usage

chmod +x server

and

./server <port>

could be any free port in your system. For example 8080.

Running the Server

To start the server, run the executable or use go run with the following command:

./server <port>
# or
go run server.go <port> 

Replace <port> with the desired port number (e.g., 8080).

! IMPORTANT, run with sudo if password needed

The server will be accessible at http://localhost:<port>.

API

The API endpoint provides information about the running system's status.

  • Endpoint: /api
  • Method: GET

Example response:

[
   {
      "unit":"accounts-daemon.service",
      "load":"loaded",
      "active":"active",
      "sub":"running",
      "description":"Accounts"
   },
   {
      "unit":"acpid.service",
      "load":"loaded",
      "active":"active",
      "sub":"running",
      "description":"ACPI"
   }
]

Service

The service endpoint enables us to start and stop services.

  • Endpoint: /service
  • Method: GET

Example Usage:

/service?open=true&service_name=MyService

Frontend

The frontend of this project consists of vanilla HTML and JavaScript. The frontend files are served at the root path ("/").

  • HTML File: index.html
  • JavaScript File: app.js

You can access the frontend at http://localhost:<port>.

Contributing

Contributions are welcome! Please follow the Contributing Guidelines for details on how to contribute to this project.