diff options
author | archimede | 2017-08-28 16:22:52 +0800 |
---|---|---|
committer | archimede | 2017-08-28 20:35:07 +0800 |
commit | 16038d6d89f2f308e2d313f5bfa622b569318a58 (patch) | |
tree | cd641099446dec5bcd7a0d7602e0b9ff16329113 | |
parent | 2b41873fc094d8447697ff3a6dab3ce6b408fea8 (diff) | |
download | aur-16038d6d89f2f308e2d313f5bfa622b569318a58.tar.gz |
add user argument to service file
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | megasync-headless.install | 3 | ||||
-rw-r--r-- | megasyncd@.service | 17 |
4 files changed, 27 insertions, 6 deletions
@@ -2,17 +2,17 @@ pkgname=megasync-headless pkgver=v3.1.9.0.g4edf31a8 -pkgrel=1 -pkgdesc="Daemon, fuse and cli client. Sync local directory with MEGA account. Original mega code (git)." +pkgrel=2 +pkgdesc="Daemon, fuse and cli client. Sync local directory with MEGA.nz account. Original mega SDK (git)." arch=('x86_64') url='https://mega.co.nz/#sync' license=('custom:MEGA') source=('git+https://github.com/meganz/sdk.git#tag=v3.1.9' - 'megasyncd.service' + 'megasyncd@.service' 'megasync.conf' ) install=$pkgname.install -backup=('usr/lib/systemd/system/megasyncd.service' +backup=('usr/lib/systemd/system/megasyncd@.service' 'etc/conf.d/megasync.conf' ) conflicts=('megasync' @@ -56,7 +56,7 @@ build() { } package() { - install -Dm644 megasyncd.service "${pkgdir}/usr/lib/systemd/system/megasyncd.service" + install -Dm644 megasyncd@.service "${pkgdir}/usr/lib/systemd/system/megasyncd@.service" install -Dm600 megasync.conf "${pkgdir}/etc/conf.d/megasync.conf" cd sdk @@ -2,7 +2,7 @@ Some notes about this package: The package creates and install 3 executables: *) megacli - advanced console MEGA client, to get information about available commands please start the -application in the Terminal and type â"h" to get commands description. +application in the Terminal and type h to get commands description. *) megasimplesync - a simple synchronization client, it gets username / password values from corresponding environment variables. *) megafuse: to mount a remote mega directory @@ -14,3 +14,4 @@ The package compiles only a subset of the original MEGA SDK, the mimimun necessa The package contains no code of mine, except for the PKGBUILD and the mega.service file. +Remember to edit the configuration file /etc/conf.d/megasync.conf diff --git a/megasync-headless.install b/megasync-headless.install index b38abe84ff57..f8a05fceee35 100644 --- a/megasync-headless.install +++ b/megasync-headless.install @@ -6,5 +6,8 @@ post_install() { usr/bin/echo "******************************************************************" usr/bin/echo " SET YOUR CREDENTIALS IN /etc/conf.d/megasync-headless.conf" +usr/bin/echo " " +usr/bin/echo " If the user is non root, ensure that the selected user has" +usr/bin/echo " permissions on the working directory and the local directories. usr/bin/echo "******************************************************************" } diff --git a/megasyncd@.service b/megasyncd@.service new file mode 100644 index 000000000000..dc093ce2272a --- /dev/null +++ b/megasyncd@.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mega sync client +After=local-fs.target network.target + +[Service] +Type=simple +User=%I +EnvironmentFile=/etc/conf.d/megasync.conf +ExecStart=/usr/bin/bash -c "cd $MEGA_WORK_DIR && /usr/local/bin/megasimplesync $MEGA_LOCAL_DIR $MEGA_REMOTE_DIR" +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=on-failure +RestartSec=30s + +[Install] +WantedBy=multi-user.target + |