{"id":2932,"date":"2016-08-03T16:57:27","date_gmt":"2016-08-03T16:57:27","guid":{"rendered":"http:\/\/wiki.davelevy.info\/?p=2932"},"modified":"2024-08-15T08:41:23","modified_gmt":"2024-08-15T08:41:23","slug":"fedora-24","status":"publish","type":"post","link":"https:\/\/davelevy.info\/wiki\/fedora-24\/","title":{"rendered":"Fedora 24"},"content":{"rendered":"<p>This is quite different, in particular the System V init files don&#8217;t work any more and so I need to implement a <code>systemd<\/code> solution to mount the virtual box shared folders. I think these need to run after the vboxaddclient service. Some documentation suggests that LSB compliant scripts will work. I am about to stop and give it a rest; I am definitely of the view that this was a problem not worth solving.<!--more--><\/p>\n<p>This where I am, having experimented with my script, I return to using a .mount file<\/p>\n<pre>B$ cat import-common.mount \r\n[Unit]\r\nDescription=Mounts common on \/import\/common\r\nRequires=vboxadd-service graphical.target\r\nAfter=vboxadd-service tmp.mount graphical.target\r\n\r\n[Mount]\r\nWhat=common\r\nWhere=\/import\/common\r\nType=vboxsf\r\nOptions=rw,uid=1000,gid=1000\r\n\r\n[Install]\r\nWantedBy=graphical.target\r\n<\/pre>\n<p>Errormessages<\/p>\n<pre>\u00b7 import-common.mount - Mounts common on \/import\/common\r\n   Loaded: loaded (\/etc\/systemd\/system\/import-common.mount; enabled;\r\n   Active: inactive(dead)\r\n    Where: \/import\/common\r\n     What: common\r\n<\/pre>\n<h3>Dead Alleys<\/h3>\n<p>So I make a .mount file, the first one fails because I didn&#8217;t know that one needs to replace the folder delimiter character i.e. &#8220;\/&#8221; in the unit file name with a &#8220;-&#8220;. This is hidden in the freedesktop.org manual pages.<\/p>\n<p>Now where are the logs? Hidden behind f*ing binaries, there is a program called journalctl but systemctl status &lt;service name or unit file name&gt; both report the service or mount state.<\/p>\n<p>I experimented with rewriting this as a service using my standard script. I discover that Fedora&#8217;s lsb functions file is in a different location to Ubuntu but the script is not a daemon and undertook both the mount and unmount operation.\u00a0 I have found the vboxadd* service unit files, they are in <code>\/lib\/systemd\/system<\/code>, they have example code to issue start and stop commands.<\/p>\n<p>I have tried to implement redhat-lsb using yum\/dnf. This has different function names to the debian version I have been using.<\/p>\n<pre>        mount -t vboxsf -o rw,uid=1000 $1 \/import\/$1\r\n\tcase $? in\r\n\t0) log_success_msg mounting shared folder $1 ;;\r\n\t*) log_failure_msg mounting shared folder $1 ;;\r\n\tesac\r\n<\/pre>\n<p>Here are some links<\/p>\n<ol>\n<li><a href=\"https:\/\/fedoraproject.org\/wiki\/Systemd\">https:\/\/fedoraproject.org\/wiki\/Systemd<\/a><\/li>\n<li><a href=\"http:\/\/searchdatacenter.techtarget.com\/tip\/Mount-file-system-Linux-systemds-way\">http:\/\/searchdatacenter.techtarget.com\/tip\/Mount-file-system-Linux-systemds-way<\/a><\/li>\n<li>https:\/\/www.linux.com\/learn\/understanding-and-using-systemd<\/li>\n<li><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd-sysv-generator.html\">https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd-sysv-generator.html<\/a><\/li>\n<li><a href=\"http:\/\/unix.stackexchange.com\/questions\/203987\/debian-services-not-running\/204075#204075\">http:\/\/unix.stackexchange.com\/questions\/203987\/debian-services-not-running\/204075#204075<\/a><\/li>\n<li><a href=\"http:\/\/unix.stackexchange.com\/questions\/233468\/how-does-systemd-use-etc-init-d-scripts\">http:\/\/unix.stackexchange.com\/questions\/233468\/how-does-systemd-use-etc-init-d-scripts<\/a><\/li>\n<li>https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.unit.html#<\/li>\n<li><a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd-sysv-generator.html\">https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd-sysv-generator.html<\/a><\/li>\n<\/ol>\n<p>Mike Davies writes,<\/p>\n<blockquote><p>&#8230;think what you need to do is create a systemd unit file named after the filesystem you want to mount. You have to make the unit filename <span style=\"color: #ff2600;\">match<\/span> the mount point. I think you can pass options to control unit file ordered using\u00a0the <span style=\"color: #0433ff;\">[Requires, Before &amp; After <\/span>directives<\/p><\/blockquote>\n<p>He also recommends,<\/p>\n<ol>\n<li>https:\/\/oguya.ch\/posts\/2015-09-01-systemd-mount-partition\/<\/li>\n<li><a class=\"\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/understanding-systemd-units-and-unit-files\">https:\/\/www.digitalocean.com\/community\/tutorials\/understanding-systemd-units-and-unit-files<\/a><\/li>\n<\/ol>\n<p>It maybe right to use a service unit, but I can&#8217;t see it myself. It looks like the thing runs start and stop.<\/p>\n<p>And this thread,<\/p>\n<ol>\n<li><a href=\"https:\/\/bbs.archlinux.org\/viewtopic.php?id=147790\">https:\/\/bbs.archlinux.org\/viewtopic.php?id=147790<\/a><\/li>\n<\/ol>\n<p>about how to do an rc.local degenerates into a lovely row about the rights and wrongs of systemd.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\">ooOOOoo<\/p>\n<p>Image Credit: Berndt Rostad <a href=\"https:\/\/www.flickr.com\/photos\/brostad\/8109668980\">@flickr<\/a> CC 2012 BY, he says &#8220;Fedora is not only a type of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Fedora\" rel=\"nofollow\">hat<\/a> and a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Fedora_(operating_system)\" rel=\"nofollow\">Linux distribution<\/a> (which I happen to use) but also a <a href=\"https:\/\/web.archive.org\/web\/20200112122747\/http:\/\/www.fedorabar.de:80\/\" rel=\"nofollow\">bar and kitchen<\/a> in Ledererstrasse 3 in Munich. Hooray.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is quite different, in particular the System V init files don&#8217;t work any more and so I need to implement a systemd solution to mount the virtual box shared folders. I think these need to run after the vboxaddclient service. Some documentation suggests that LSB compliant scripts will work. I am about to stop&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2933,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[8,3],"tags":[365,916,1056,911],"class_list":["post-2932","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-technology","tag-fedora","tag-linux","tag-systemd","tag-technology"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2016\/08\/fedora.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/comments?post=2932"}],"version-history":[{"count":3,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2932\/revisions"}],"predecessor-version":[{"id":11264,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/2932\/revisions\/11264"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media\/2933"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media?parent=2932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/categories?post=2932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/tags?post=2932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}