Skip to content

Instantly share code, notes, and snippets.

@stonebyte
Last active May 14, 2024 21:05
Show Gist options
  • Save stonebyte/ee553dca2a994343cdf3a038f2663ca5 to your computer and use it in GitHub Desktop.
Save stonebyte/ee553dca2a994343cdf3a038f2663ca5 to your computer and use it in GitHub Desktop.
Start MinIO as service on Synology NAS

Run MinIO as upstart service on Synology NAS

IMPORTANT UPDATE

I just figured out that MinIO is available via Synocommunity. You should install it from there and NOT use the method I describe here.

Get the right MinIO binary

Depending on the CPU in your NAS you need to download the matching binary from https://dl.min.io/server/minio/release/

For my aging 2-Bay Syno with an ARM CPU it would be something like this:

cd /tmp
wget https://dl.min.io/server/minio/release/linux-arm/minio

Make the file executable and move to a propper place

chmod +x minio
mv minio /usr/bin/

Create service

Synology uses upstart as init system. We need to write an upstart script to get minio running on start up.

The script needs to go into /etc/init as minio.conf.

start on runlevel 1 and syno.share.ready and syno.network.ready

stop on runlevel [06]

setuid <your backup user>


env MINIO_ACCESS_KEY=<your access key>
env MINIO_SECRET_KEY=<your secret key>

exec /usr/bin/minio --config-dir /etc/minio server <path to repo>
💡

For some reason, the option --config-dir /etc/minio is needed by the version of minio I was using. Although beeing deprecated, the option was required to make the service start up. Running it from the commandline worked without the option. The provided directory /etc/minio does not exist on my system, but that didn’t seem to matter.

🔥

The service desctiption is containing your minio root crendentials. You should set appropriate access rights.

chmod 700 /etc/init/minio.conf

Use service

To make upstart aware of the new service do initctl reload-configuration.

Start the service manually with initctl start minio.

Check if the service is running with initctl status minio.

Stop the service manually with initctl stop minio.

Caveat

Synology offered an update for the antic DSM running on my syno. After installing it, the minio service was gone and I had to do the above descried steps again.

Check if the service is still there after any DSM update!

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