[prev in list] [next in list] [prev in thread] [next in thread]
List: fuse-devel
Subject: Re: [fuse-devel] fuse can not be mounted by systemd
From: Anudorannador <anudorannador () gmail ! com>
Date: 2017-06-26 3:14:11
Message-ID: CAOi79+ZyGT06R4YumVDHiy9g7ZvAMHjOT5QfypQr91gDANWVyg () mail ! gmail ! com
[Download RAW message or body]
Oh, I've found the reason: remove `PrivateTmp=true' and solved. :)
2017-06-24 1:14 GMT+08:00 Nikolaus Rath <Nikolaus@rath.org>:
> On Jun 23 2017, Anudorannador <anudorannador-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hi !
>> I wrote a program, and there is a pice of the code:
>> ```
>> char *fa[] = { "-f", "-odefault_permissions", "-oallow_other", NULL};
>>
>> struct fuse_args fuse_args = FUSE_ARGS_INIT(sizeof
>> (fa)/sizeof(gpointer) - 1, fa);
>>
>> struct fuse_chan *fuse_chan = fuse_mount(CFSDIR, &fuse_args);
>> if (!fuse_chan) {
>> fprintf("fuse_mount error: %s", strerror(errno));
>> exit(-1);
>> }
>>
>> if (!(fuse = fuse_new(fuse_chan, &fuse_args, &fuse_ops,
>> sizeof(fuse_ops), NULL))) {
>> fprintf("fuse_new error: %s", strerror(errno));
>> exit(-1);
>> }
>>
>> fuse_set_signal_handlers(fuse_get_session(fuse));
>> ...
>> while(1){ ... }
>> ```
>> When I run the program by cmd, that is:
>> # ./myprog
>> It works well. CFSDIR, which is a macro of '/etc/xxx', is mounted:
>> # df -h | grep /etc/xxx
>> # /dev/fuse 30M 12K 30M 1% /etc/xxx
>> The question is when I use systemd to start it :
>> # systemctl start myprog.service
>> it seems fine, no error but dirctory /etc/xxx not be mounted.
>> And catch nothing with command `df -h | grep /etc/xxx`
>>
>> Here is my service:
>> ```
>> [Unit]
>> Description=xxx
>> ConditionPathIsMountPoint=!/etc/xxx
>> After=network.service
>>
>> [Service]
>> Type=simple
>> ExecStart=/usr/bin/myprog
>> PrivateTmp=true
>>
>> [Install]
>> WantedBy=multi-user.target
>> ```
>>
>> Could you please help me ? Thanks.
>
> Your program seems to daemonize, yet your service file claims its of
> Type=simple. You probably have to either define it as Type=forking or
> (better) change your program to not daemonize.
>
> Also, systemctl status myprogr.service should give you more details.
>
> Best,
> -Nikolaus
>
> --
> GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F
>
> »Time flies like an arrow, fruit flies like a Banana. «
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> --
> fuse-devel mailing list
> To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
fuse-devel mailing list
To unsubscribe or subscribe, visit https://lists.sourceforge.net/lists/listinfo/fuse-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic