Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sentience/b034ef703e6a373556ed793b2261dbe7 to your computer and use it in GitHub Desktop.
Save sentience/b034ef703e6a373556ed793b2261dbe7 to your computer and use it in GitHub Desktop.
MEGAcmd startup on Synology DSM

Last verified on Synology DSM 7.0.1.

Prerequisites

  • install MEGAcmd package in DSM package center
  • enable user home service (Control Panel → User & Group → Advanced → User Home)
  • set up MEGAcmd so you can run mega-cmd-server from your Synology terminal prompt and see the server start (then use Ctrl-C to stop it)

Set up sysctld service for MEGAcmd server

  • Edit the provided mega-cmd-server.service file to replace username (in User and WorkingDirectory) with your Synology user name
  • Place the file in /etc/systemd/system (e.g. sudo mv mega-cmd-server.service /etc/systemd/system)
  • Make sure the file is owned by the root user (e.g. sudo chown root:root /etc/systemd/system/mega-cmd-server.service)
  • Reload your systemd daemon files: sudo systemctl daemon-reload
  • Start the service: sudo systemctl start mega-cmd-server
  • Verify the server is running by checking its status and log output: sudo systemctl status mega-cmd-server
  • Enable the service to be started automatically at startup: sudo systemctl enable mega-cmd-server

Reboot to check if it works. Enjoy!

[Unit]
Description=MEGAcmd server
After=syslog.target network-online.target
AssertFileIsExecutable=/usr/local/bin/mega-cmd-server
[Service]
User=username
Group=users
Type=simple
WorkingDirectory=/var/services/homes/username
ExecStart=/usr/local/bin/mega-cmd-server
Restart=always
LimitNOFILE=65536
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=mega-cmd-server
[Install]
WantedBy=multi-user.target
@expbox77
Copy link

THX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment