run fuse failed by systemctl

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

run fuse failed by systemctl

Anudorannador
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.

------------------------------------------------------------------------------
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