Skip to content

A background project manager for Debian and Debian-based Linux distributions. This tool automatically manages and runs multiple projects in persistent screen sessions using systemd for service management

Notifications You must be signed in to change notification settings

Vu4ll/project-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Project Manager is a lightweight system service that automatically starts, stops, and monitors multiple projects on your server or workstation. It uses GNU Screen for persistent terminal sessions and systemd for reliable service management, making it ideal for managing development servers, automation scripts, and long-running processes.

Features

  • Automatic Startup: Projects start automatically on system boot via systemd
  • Persistent Sessions: Uses GNU Screen to keep projects running in the background
  • Multi-User Support: Run different projects under different user accounts
  • Centralized Management: Control all projects from a single configuration file
  • Service Integration: Full systemd integration with enable/disable/status support
  • Log Management: Automatic log rotation using logrotate
  • Lock Protection: Prevents multiple instances from running simultaneously
  • Graceful Shutdown: Properly stops all projects during system shutdown

Technologies Used

  • systemd: Service management and automatic startup
  • GNU Screen: Persistent terminal sessions for background processes
  • Bash: Shell scripting for project management
  • logrotate: Automatic log file rotation and compression

Requirements

  • Debian, Ubuntu, or any Debian-based Linux distribution
  • systemd (pre-installed on most modern Linux systems)
  • Root/sudo access for installation
  • GNU Screen (automatically installed during setup)

Installation

  1. Clone or download this repository:
git clone https://github.com/Vu4ll/project-manager project-manager
cd project-manager
  1. Run the installation script as root:
sudo ./install.sh

The installer will:

  • Install GNU Screen if not already present
  • Create necessary directories
  • Copy files to system locations
  • Set up the systemd service
  • Configure log rotation

Configuration

Edit the configuration file to add your projects:

sudo nano /etc/project-manager/projects.conf

Configuration Format

Each line represents one project with the following format:

project_name|project_path|start_command|user_name

Example Configuration

# Web application
myWebProject|/home/vu4ll/projects/myweb|npm start|vu4ll

# Python script
dataAnalysis|/home/vu4ll/projects/data_analysis|python analyze.py|vu4ll

# Django development server
djangoApp|/home/vu4ll/projects/django_app|python manage.py runserver|vu4ll

# Node.js API server
apiServer|/home/vu4ll/projects/api|node server.js|vu4ll

Notes:

  • Lines starting with # are comments
  • project_name: Unique identifier for the screen session
  • project_path: Working directory for the project
  • start_command: Command to start the project
  • user_name: Linux user account to run the project under

Usage

Starting the Service

# Start the service immediately
sudo systemctl start project-manager.service

# Enable automatic startup on boot
sudo systemctl enable project-manager.service

# Start and enable in one command
sudo systemctl enable --now project-manager.service

Manual Control

You can also use the script directly:

# Start all projects
sudo project-manager.sh start

# Stop all projects
sudo project-manager.sh stop

# Check status of all projects
sudo project-manager.sh status

# Restart all projects
sudo project-manager.sh restart

Checking Service Status

# Check systemd service status
sudo systemctl status project-manager.service

# View logs
sudo tail -f /var/log/project-manager.log

# View journalctl logs
sudo journalctl -u project-manager.service -f

Accessing Running Projects

To access a running project's screen session:

# List all screen sessions
screen -ls

# Attach to a specific project
sudo screen -r project_name

# Detach from screen session
# Press: Ctrl+A, then D

File Locations

  • Main Script: /usr/local/bin/project-manager.sh
  • Configuration: /etc/project-manager/projects.conf
  • Systemd Service: /etc/systemd/system/project-manager.service
  • Log File: /var/log/project-manager.log
  • Logrotate Config: /etc/logrotate.d/project-manager
  • Lock File: /var/run/project-manager.lock

Uninstallation

To remove Project Manager from your system:

sudo ./uninstall.sh

The uninstall script will:

  • Stop and disable the service
  • Terminate all running project sessions
  • Remove system files
  • Ask before removing configuration and logs

About

A background project manager for Debian and Debian-based Linux distributions. This tool automatically manages and runs multiple projects in persistent screen sessions using systemd for service management

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages