LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-02-2021, 04:26 AM   #1
dr-ing
LQ Newbie
 
Registered: Mar 2020
Posts: 19

Rep: Reputation: Disabled
Stopping systemd service before stopping/unmountig s3fs fuse connection


Hello,

my application, which runs on a debian 10 server, writes/reads data from a s3 object storage but, as some parts of the software aren't 100% s3 compatible yet, not directly via the s3 api but instead over a s3fs fuse.

Since the server running the application is a stateless instance in a cloud environment, it may/will terminate at some point. Therefore, I need to make sure that the application is shutdown properly to avoid data corruption, e.g. in case of asynchronous jobs.

The problem is that in case of a shutdown, the s3 fuse is unmounted before the application is killed and therefore the application cannot finish its asynchronous file operations. I need to make sure that the s3 drive is unmounted after the application exits.

The s3fs drive is mounted with the following shell command:
Code:
/usr/bin/s3fs bucket-name /mountpoint -o gid=33 -o uid=33 -o allow_other -o umask=0000 -o passwd_file=/tmp/.qbqWCbnHRBlAKxmiesZKlEpGEmerSUwC
After this, this service unit exists:
Code:
mountpoint.mount loaded active mounted /mountpoint
This is my service file with all the 'Wants' Statements I already tried:
Code:
[Unit]
Description = My application
After=network.target
Wants=network.target 
Wants=remote-fs.target
Wants=sys-fs-fuse-connections.mount
Wants=basic.target
Wants=mountpoint.mount

[Service]
ExecStart = /opt/application
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartForceExitStatus=SIGPIPE
KillMode=control-group
KillSignal=SIGTERM
TimeoutSec=900

[Install]
WantedBy = multi-user.target
I noticed that at the point where the application process exits, the nfs drives are still active (presumably because of remote-fs.target?), but I did not archive that the s3fs drives are still mounted.

Does anyone have any tips on how I can solve this problem?

Thanks for every answer and best regards


(Some versions if this can help:
  • OS: Debian 10.9
  • Kernel: 4.19.0-16-amd64
  • Systemd: 241
  • cloud-init: 20.2
  • s3fs: 1.89
)
 
Old 07-03-2021, 02:19 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by dr-ing View Post
The problem is that in case of a shutdown, the s3 fuse is unmounted before the application is killed and therefore the application cannot finish its asynchronous file operations. I need to make sure that the s3 drive is unmounted after the application exits.
So you wrote that systemd service to achieve that?
And it does not work as expected?
First of all you should look at the journal, maybe it tells you why the stopping/unmoounting did not succeed.
 
  


Reply

Tags
cloud-init, fuse, systemd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Mount S3 Bucket on Linux CentOS, RHEL and Ubuntu using S3FS LXer Syndicated Linux News 0 06-12-2017 08:06 PM
[SOLVED] Fuse installation problems: "cannot remove `/sbin/mount.fuse': Permission denied" kvm1983 Linux - Software 3 02-05-2012 11:34 PM
Upgrading fuse in order to use current version of s3fs FilmoTheKlown Linux - Software 7 12-21-2011 07:38 AM
fusermount: fuse device not found, try 'modprobe fuse' first maestromani Linux - Newbie 1 10-21-2010 12:53 PM
FUSE works but fuse group does not exist? violagirl23 Linux - Software 3 01-21-2008 04:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration