Always try 'umount -i'

This commit is contained in:
wbaumann 2014-04-05 20:27:31 +00:00
parent 2b1f99b123
commit 9a3e7724be
5 changed files with 68 additions and 34 deletions

View File

@ -1,6 +1,10 @@
ChangeLog for davfs2
--------------------

2014-04-05 Werner Baumann (werner.baumann@onlinehome.de)
* umount_davfs.c:
Allways try 'umount -i'.

2014-04-05 Werner Baumann (werner.baumann@onlinehome.de)
* configure.ac, src/Makefile.am, defaults.h,
mount_davfs.h, mount_davfs.c:

View File

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://savannah.nongnu.org/support/?"
"func=additem&group=davfs2\n"
"POT-Creation-Date: 2014-04-05 20:13+0200\n"
"POT-Creation-Date: 2014-04-05 22:21+0200\n"
"PO-Revision-Date: 2007-05-03 19:50+0200\n"
"Last-Translator: Vítězslav Kotrla <vitko@post.cz>\n"
"Language-Team: <cs@li.org>\n"
@ -636,12 +636,20 @@ msgstr ""
" umount <mountpoint> : odpojit zdroj WebDAV tak, jak je určeno\n"
" v /etc/fstab.\n"

#: src/umount_davfs.c:131
#, c-format
msgid "can't determine mount point"
msgstr "nemohu určit přípojný bod"
#: src/umount_davfs.c:135
#, fuzzy, c-format
msgid ""
"\n"
" can't evaluate PID file name;\n"
" trying to unmount anyway;\n"
" please wait for %s to terminate"
msgstr ""
"\n"
" nemohu číst PID ze souboru %s;\n"
" přesto se pokouším odpojit;\n"
" čekejte prosím, až %s skončí"

#: src/umount_davfs.c:151
#: src/umount_davfs.c:158
#, c-format
msgid ""
"\n"
@ -654,7 +662,7 @@ msgstr ""
" přesto se pokouším odpojit;\n"
" čekejte prosím, až %s skončí"

#: src/umount_davfs.c:163
#: src/umount_davfs.c:170
#, c-format
msgid ""
"\n"
@ -667,7 +675,7 @@ msgstr ""
" přesto se pokouším odpojit;\n"
" čekejte prosím, až %s skončí"

#: src/umount_davfs.c:179
#: src/umount_davfs.c:186
#, c-format
msgid ""
"\n"
@ -680,12 +688,12 @@ msgstr ""
" přesto se pokouším odpojit.\n"
" pravděpodobně budete muset odstranit %s ručně"

#: src/umount_davfs.c:190
#: src/umount_davfs.c:197
#, c-format
msgid "%s: waiting while %s (pid %s) synchronizes the cache ."
msgstr "%s: čekám, než si %s (pid %s) sesynchronizuje vyrovnávací paměť."

#: src/umount_davfs.c:203
#: src/umount_davfs.c:210
#, c-format
msgid "an error occured while waiting; please wait for %s to terminate"
msgstr "při čekání došlo k chybě; čekejte prosím až %s skončí"
@ -814,6 +822,9 @@ msgstr " identita: %s"
msgid " accepted by user"
msgstr " přijat uživatelem"

#~ msgid "can't determine mount point"
#~ msgstr "nemohu určit přípojný bod"

#~ msgid "trying fuse kernel file system"
#~ msgstr "zkouším jaderný souborový systém fuse"


View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: davfs2 1.4.6\n"
"Report-Msgid-Bugs-To: http://savannah.nongnu.org/support/?"
"func=additem&group=davfs2\n"
"POT-Creation-Date: 2014-04-05 20:13+0200\n"
"POT-Creation-Date: 2014-04-05 22:21+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -574,12 +574,16 @@ msgid ""
" /etc/fstab.\n"
msgstr ""

#: src/umount_davfs.c:131
#: src/umount_davfs.c:135
#, c-format
msgid "can't determine mount point"
msgid ""
"\n"
" can't evaluate PID file name;\n"
" trying to unmount anyway;\n"
" please wait for %s to terminate"
msgstr ""

#: src/umount_davfs.c:151
#: src/umount_davfs.c:158
#, c-format
msgid ""
"\n"
@ -588,7 +592,7 @@ msgid ""
" please wait for %s to terminate"
msgstr ""

#: src/umount_davfs.c:163
#: src/umount_davfs.c:170
#, c-format
msgid ""
"\n"
@ -597,7 +601,7 @@ msgid ""
" please wait for %s to terminate"
msgstr ""

#: src/umount_davfs.c:179
#: src/umount_davfs.c:186
#, c-format
msgid ""
"\n"
@ -606,12 +610,12 @@ msgid ""
" you propably have to remove %s manually"
msgstr ""

#: src/umount_davfs.c:190
#: src/umount_davfs.c:197
#, c-format
msgid "%s: waiting while %s (pid %s) synchronizes the cache ."
msgstr ""

#: src/umount_davfs.c:203
#: src/umount_davfs.c:210
#, c-format
msgid "an error occured while waiting; please wait for %s to terminate"
msgstr ""

View File

@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: davfs2 1.5.0\n"
"Report-Msgid-Bugs-To: http://savannah.nongnu.org/support/?"
"func=additem&group=davfs2\n"
"POT-Creation-Date: 2014-04-05 20:13+0200\n"
"PO-Revision-Date: 2014-04-05 20:19+0200\n"
"POT-Creation-Date: 2014-04-05 22:21+0200\n"
"PO-Revision-Date: 2014-04-05 22:23+0200\n"
"Last-Translator: Werner Baumann <werner.baumann@onlinehome.de>\n"
"Language-Team: \n"
"Language: de\n"
@ -643,12 +643,20 @@ msgstr ""
" umount <server-url> : hänge die WebDAV-Resource entsprechend den\n"
" Angaben in /etc/fstab aus.\n"

#: src/umount_davfs.c:131
#: src/umount_davfs.c:135
#, c-format
msgid "can't determine mount point"
msgstr "kann den Einhängepunkt nicht ermitteln"
msgid ""
"\n"
" can't evaluate PID file name;\n"
" trying to unmount anyway;\n"
" please wait for %s to terminate"
msgstr ""
"\n"
" kann den Namen der PID-Datei nicht ermitteln;\n"
" versuche trotzdem das Dateisystem auszuhängen;\n"
" bitte warte bis der %s-Prozess endet"

#: src/umount_davfs.c:151
#: src/umount_davfs.c:158
#, c-format
msgid ""
"\n"
@ -661,7 +669,7 @@ msgstr ""
" versuche trotzdem das Dateisystem auszuhängen;\n"
" bitte warte bis der %s-Prozess endet"

#: src/umount_davfs.c:163
#: src/umount_davfs.c:170
#, c-format
msgid ""
"\n"
@ -674,7 +682,7 @@ msgstr ""
" versuche trotzdem das Dateisystem auszuhängen;\n"
" bitte warte bis der %s-Prozess endet"

#: src/umount_davfs.c:179
#: src/umount_davfs.c:186
#, c-format
msgid ""
"\n"
@ -687,14 +695,14 @@ msgstr ""
" versuche trotzdem das Dateisystem auszuhängen;\n"
" %s muss wahrscheinlich von Hand gelöscht werden"

#: src/umount_davfs.c:190
#: src/umount_davfs.c:197
#, c-format
msgid "%s: waiting while %s (pid %s) synchronizes the cache ."
msgstr ""
"%s: warte bis %s (PID %s) die Dateien im Cache\n"
"gesichert hat ."

#: src/umount_davfs.c:203
#: src/umount_davfs.c:210
#, c-format
msgid "an error occured while waiting; please wait for %s to terminate"
msgstr ""

View File

@ -125,10 +125,19 @@ main(int argc, char *argv[])
error(EXIT_FAILURE, 0, _("too many arguments"));

char *mpoint = canonicalize_file_name(argv[optind]);
if (!mpoint)
mpoint = argv[optind];
if (!mpoint || *mpoint != '/')
error(EXIT_FAILURE, errno, _("can't determine mount point"));

char *umount_command = NULL;
if (mpoint) {
umount_command = ne_concat("umount -i '", mpoint, "'", NULL);
} else {
umount_command = ne_concat("umount -i '", argv[optind], "'", NULL);
error(0, 0,
_("\n"
" can't evaluate PID file name;\n"
" trying to unmount anyway;\n"
" please wait for %s to terminate"), PROGRAM_NAME);
return system(umount_command);
}

char *m = mpoint;
while (*m == '/')
@ -142,8 +151,6 @@ main(int argc, char *argv[])
char *pidfile = xasprintf("%s/%s.pid", DAV_SYS_RUN, mp);
free(mp);

char *umount_command = xasprintf("umount -i '%s'", mpoint);

char pid[32];
FILE *file = fopen(pidfile, "r");
if (!file || fscanf(file, "%30[0-9]", pid) < 1) {