Repository navigation
Description
Summary
On a system without systemd, mtproxymax telegram setup reports success and sends a test
message, but never starts the bot daemon and never schedules it. Unlike the two other
service-installing features in the same script, it fails silently — no warning, no hint,
no fallback.
The bot then stays dead, which also means no alerts are ever delivered.
Impact
Users on OpenRC/Alpine get a bot that looks configured but is not running. Because the wizard
prints [✓] Telegram bot configured! and [✓] Test message sent, there is no signal that
anything is wrong. The user loses the entire alert channel — including "proxy down"
notifications — without knowing.
The same blind spot makes the management commands lie as well:
mtproxymax telegram statusprintsTelegram: ● Enabledwhile the daemon is dead. It echoes
theTELEGRAM_ENABLEDsetting and never checks whether the process exists.mtproxymax telegram disableprintsTelegram disabledand leaves the daemon running.
Both were reproduced on the test box with the bot service genuinely stopped.
Environment
- MTProxyMax: v1.4.0-LTS (
06ad79a) - OS: Alpine Linux, OpenRC 0.63.2 (unprivileged LXC container), no systemd
command -v systemctl→ nothing;command -v rc-service→/sbin/rc-service
Alpine is otherwise a supported platform: detect_os maps it (alpine), there are apk
package branches, and alpine:latest is used for QR generation. The README lists Alpine under
System Requirements. Line numbers below are for 06ad79a and will drift.
Steps to reproduce
- Run
mtproxymax telegram setup— provide a bot token, send/startto the bot, accept the
defaults. - Observe the wizard complete successfully.
pgrep -af mtproxymax-telegram→ no process.ls /etc/init.d/→ nomtproxymax*;crontab -l→ no entry (only stockrun-parts).- The Telegram bot never responds to any command.
Root cause
setup_telegram_service() (~line 12123) installs a systemd unit only, with no else branch:
setup_telegram_service() {
telegram_generate_service_script
# Create systemd service
if command -v systemctl &>/dev/null; then
cat > /etc/systemd/system/mtproxymax-telegram.service << 'SERVICE_EOF'
...
SERVICE_EOF
systemctl daemon-reload
systemctl enable mtproxymax-telegram.service 2>/dev/null
systemctl restart mtproxymax-telegram.service 2>/dev/null
log_success "Telegram bot service started"
fi
}The log_success sits inside the if, so on OpenRC the function neither installs anything
nor reports anything. The daemon script itself (telegram_generate_service_script, line
~11106) is generated correctly, so the caller has nothing to notice: telegram_setup_wizard
invokes setup_telegram_service as a bare statement at line ~11101 and discards its exit
status.
The unconditional systemctl calls in telegram disable (~15553), telegram remove
(~15562) and the interactive menu toggle (~17239) behave the same way: 2>/dev/null || true
turns "no systemd here" into an invisible no-op, and the success message still prints.
The same bug in two more places
setup_autostart()(~13231) — the mainmtproxymax.serviceautostart has the identical
no-elsebug, so "start on boot" is silently broken on the same hosts.self_update()(~10039) — the post-update restart is gated on
command -v systemctl && [ -f /etc/systemd/system/mtproxymax-telegram.service ], so on
OpenRC the bot is silently never restarted after an update.
Inconsistency with sibling features
Two other places already avoid this, which is why it reads as an oversight rather than an
intentional limitation:
- Docker enable (~line 1062) — explicit OpenRC fallback:
systemctl enable docker 2>/dev/null || rc-update add docker default 2>/dev/null || true
systemctl start docker 2>/dev/null || service docker start 2>/dev/null || true- Replication sync (
setup_replication_service, ~line 12555) — warns and prints the cron
line, thenreturn 1:
if ! command -v systemctl &>/dev/null; then
log_warn "systemd not found. Add cron manually:"
echo " * * * * * /bin/bash ${INSTALL_DIR}/mtproxymax-sync.sh"
return 1
fiTo be precise: that does not schedule anything on a non-systemd host — it only avoids the
silence. The Telegram path is the only one of the three that says nothing at all.
Suggested fix
Implement OpenRC support rather than just warning, since Alpine is documented as supported:
- Write
/etc/init.d/mtproxymax-telegramusingsupervisor=supervise-daemon
(respawn_delay=10,respawn_max=0) to mirror the systemd unit'sRestart=on-failure/
RestartSec=10, register it withrc-update add ... default, and start it via
rc-service ... restart. - Give
setup_autostartthe same treatment, with a plain start/stop script mirroring
Type=oneshot+RemainAfterExit=yes. - Route the update / disable / remove / uninstall paths through the same detection so they
stop reporting work they did not do, and maketelegram statusinspect the service instead
of the settings flag. - Warn loudly when neither init system is present, the way
setup_replication_service
already does.
A PR implementing the above is coming shortly.
Workaround
Hand-write /etc/init.d/mtproxymax-telegram around supervise-daemon and enable it in the
default runlevel. Note that until this is fixed, telegram disable will not stop the daemon
and telegram status will not report it accurately.
Activity
SamNet-dev commentedon Sep 15, 2026
Resolved and closed via PR #130.
Thank you @rvalitov for reporting this issue in detail and providing the complete OpenRC service implementation! 🎉 Available now on
main.