Skip to content
TenunLangPublic

About

Process manager aplikasi Tenun (ala PM2): auto-restart, multi-app, logs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tenun-pm

Process manager untuk aplikasi Tenun — seperti PM2. Jaga app tetap hidup (auto-restart saat crash), kelola banyak app, lihat log, dan jalan ulang saat boot. Tanpa root, tanpa daemon eksternal: tiap app diawasi satu supervisor terlepas dari terminal.

Pasang

curl -fsSL https://raw.githubusercontent.com/TenunLang/tenun-pm/main/install.sh | bash

Root → /usr/local/bin, non-root → ~/.local/bin. Butuh biner tenun di PATH (atau set TENUN_BIN=/path/ke/tenun).

Pakai

# Start (nama otomatis dari nama berkas; auto-restart aktif)
tenun-pm start index.tenun --name toko --cwd /www/wwwroot/toko --port 8080

# Banyak env
tenun-pm start index.tenun --name toko --env TENUN_WORKERS=2 --env PGHOST=db.internal

tenun-pm list                 # status, pid, uptime, jumlah restart
tenun-pm logs toko -f         # ikuti stdout+stderr
tenun-pm restart toko
tenun-pm stop toko            # atau: all
tenun-pm delete toko
tenun-pm info toko

Autostart saat boot

tenun-pm save          # simpan daftar app yang aktif
tenun-pm startup       # pasang systemd --user (atau cron @reboot)

startup menulis unit systemd --user yang menjalankan tenun-pm resurrect. Agar jalan tanpa login: sudo loginctl enable-linger $USER.

Perintah

Perintah Fungsi
start <skrip> [opsi] Jalankan app di latar + awasi (auto-restart).
stop <nama|all> Hentikan (matikan supervisor + anak).
restart <nama|all> Mulai ulang.
delete <nama|all> Hentikan + hapus dari daftar.
list Daftar app: status/pid/uptime/restart.
info <nama> Detail + lokasi log.
logs <nama> [-f] [--lines N] Lihat/ikuti log.
save / resurrect Simpan / pulihkan daftar app.
startup Pasang autostart boot.

Opsi start: --name, --cwd, --port (→ TENUN_PORT), --env K=V (boleh berulang), --no-restart.

Cara kerja

  • Tiap app punya supervisor (setsid, terlepas dari terminal) yang menjalankan tenun <skrip> lalu menunggu; bila keluar dan auto-restart aktif, dijalankan ulang.
  • Penjaga flapping: bila app mati <2 detik sebanyak 5x berturut, ditandai errored dan berhenti (cegah loop restart tak berujung).
  • State di ~/.tenun-pm/ (apps/, pids/, logs/). Ubah lewat env TENUN_PM_HOME.
  • stdout → logs/<nama>-out.log, stderr → logs/<nama>-err.log.

tenun-pm vs tenun-server

  • tenun-pm: process manager umum (mana saja), auto-restart, multi-app, log — tanpa root.
  • tenun-server: deploy terintegrasi nginx/aaPanel (reverse proxy + systemd per domain).

Pakai bersama: tenun-server untuk vhost/proxy, atau tenun-pm untuk kelola proses lepas.

Lisensi

MIT.

About

Process manager aplikasi Tenun (ala PM2): auto-restart, multi-app, logs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages