Codjixd is a lightweight and flexible service manager for Linux systems and Docker containers.
bash to run. Make sure you have it installed.procps it is required to work properly.less it is optional to get live logs.apk add bash procps less
# 1. Get the script:
wget https://dub.sh/codjixd -O codjixd.sh
# 2. Make it executable:
chmod +x codjixd.sh
# 3. Add script to $PATH:
sudo mv codjixd.sh /usr/bin/codjixd
# 4. Final setup:
mkdir -p /opt/codjixd/services
sudo chown -R $USER /opt/codjixd
docker pull codjix/codjixd:latest
Usage: codjixd <command> [<service>]
Commands:
start <service> Start a service
stop <service> Stop a service
restart <service> Restart a service
kill <service> Kill a service and its dependencies
status <service> Show status and metrics for a service
logs <service> Tail logs for a service
list, ls List all available services
version Show version information
help Show this help message
Options:
-v, --version Show version information
-h, --help Show this help message
Codjixd uses a configuration file located at /etc/codjixd.conf. You can customize the following variables:
BASE_DIR="/opt/codjixd" # Base directory for logs, PIDs, and services
LOG_DIR="$BASE_DIR/logs" # Directory for service logs
PID_DIR="$BASE_DIR/pids" # Directory for PID files
SERVICES_DIR="$BASE_DIR/services" # Directory for service scripts
To create a service for Codjixd, follow these steps:
Create a Service Script:
services directory (default: /opt/codjixd/services).Serivce name is considered as the script name without ".sh" extension so keep it simple.start_fn function, which contains the logic to start the service.health_check function for custom health checks and a depend_on array for service dependencies.Example Service Script:
#!/bin/bash
# Dependencies (optional)
depend_on=("service_1" "service_2" "service_3")
# Start function (required)
# This function should run as a daemon(does not exit)
start_fn() {
echo "Starting my_service..."
# Add your service start logic here
while true; do
echo "my_service is running..."
sleep 10
done
}
# Health check function (optional)
health_check() {
# Add your health check logic here
if curl -s http://localhost:8080/health > /dev/null; then
return 0
else
return 1
fi
}
Contributions are welcome! Please read the Contributing Guidelines for details.
Codjixd is licensed under the MIT License. See LICENSE for more details.
Content type
Image
Digest
sha256:0102c49cc…
Size
4.6 MB
Last updated
over 1 year ago
docker pull codjix/codjixd