[systemd-devel] How to mount NFS prior to start postgresql from this volume

killermoehre killermoehre at gmx.net
Fri Jul 1 15:44:36 UTC 2016


Am 01.07.2016 um 17:29 schrieb killermoehre:
> Am 01.07.2016 um 16:44 schrieb wolfgang.wagner at riwa-gis.de:
>> Hello list,
>>
>>  
>>
>> after days of reading man-pages and searching the web i have no solution
>> to my problem, and I am lost in the documentation.
>>
>> My system is Debian Jessie 8.5, upgraded from wheezy 7.11. With Debian
>> wheezy all works fine, after the upgrade to jessie my postgresql-service
>> does not start on boot automatically.
>>
>> Starting manually after booting works fine, but this is not a option for
>> a database-server.
>>
>> I want do some simple thing, which worked with SysV-Init without any
>> problems:
>>
>>  
>>
>> Starting postgresql from a NFS-mount.
>>
>>  
>>
>> I am not able to achieve this. The error is always the same:
>>
>>  
>>
>> Jul 01 16:11:27 postgis1 postgresql at 9.4-main[536]: Error:
>> /mnt/daten/postgis/9.4/main is not accessible or does not exist
>>
>> Jul 01 16:11:27 postgis1 systemd[1]: postgresql at 9.4-main.service:
>> control process exited, code=exited status=1
>>
>> Jul 01 16:11:27 postgis1 systemd[1]: Failed to start PostgreSQL Cluster
>> 9.4-main.
>>
>> Jul 01 16:11:27 postgis1 systemd[1]: Unit postgresql at 9.4-main.service
>> entered failed state.
>>
>>  
>>
>> A few lines after these log-lines i  find this:
>>
>>  
>>
>> Jul 01 16:11:28 postgis1 rpcbind[818]: Starting rpcbind daemon....
>>
>> Jul 01 16:11:28 postgis1 rpc.statd[861]: Version 1.2.8 starting
>>
>> Jul 01 16:11:28 postgis1 rpc.statd[861]: Flags: TI-RPC
>>
>> Jul 01 16:11:28 postgis1 kernel: FS-Cache: Loaded
>>
>> Jul 01 16:11:28 postgis1 kernel: RPC: Registered named UNIX socket
>> transport module.
>>
>> Jul 01 16:11:28 postgis1 kernel: RPC: Registered udp transport module.
>>
>> Jul 01 16:11:28 postgis1 kernel: RPC: Registered tcp transport module.
>>
>> Jul 01 16:11:28 postgis1 kernel: RPC: Registered tcp NFSv4.1 backchannel
>> transport module.
>>
>> Jul 01 16:11:28 postgis1 kernel: FS-Cache: Netfs 'nfs' registered for
>> caching
>>
>>  
>>
>> It seems to me, that NFS-mounts were done after trying to start postgresql.
>>
>>  
>>
>> My postgresql.service is this:  (unmodified file)
>>
>> [Unit]
>>
>> Description=PostgreSQL RDBMS
>>
>>  
>>
>> [Service]
>>
>> Type=oneshot
>>
>> ExecStart=/bin/true
>>
>> ExecReload=/bin/true
>>
>> RemainAfterExit=on
>>
>>  
>>
>> [Install]
>>
>> WantedBy=multi-user.target
>>
>> -----------------------------------------------------------
>>
>> Modifications in section [Unit] like :
>>
>> ConditionPathExists=/mnt/daten/postgis
>>
>>  
>>
>> Requires=mnt-daten-postgis.mount
>>
>> Before=mnt-daten-postgis.mount
>>
>> (and creating a Unit-file for the mount-point, enabling etc. instead of
>> /etc/fstab) don’t change the problem.
>>
>>  
>>
>> After booting is complete, the mount is available, but not at the time,
>> when postgresql should  be startet.
>>
>>  
>>
>> Maybe it is caused by this  (ssome lines before in journalctl-log):
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Cannot add dependency job for unit
>> display-manager.service, ignoring: Unit display-manager.service f
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found ordering cycle on
>> basic.target/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
>> sysinit.target/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
>> rpcbind.service/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
>> network-online.target/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on
>> vmware-tools.service/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Found dependency on basic.target/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Breaking ordering cycle by deleting
>> job rpcbind.service/start
>>
>> Jul 01 16:09:57 postgis1 systemd[1]: Job rpcbind.service/start deleted
>> to break ordering cycle starting with basic.target/start
>>
>>  
>>
>>  
>>
>> Where is my error?
>>
>>  
>>
>>  
>>
>> mit freundlichen Grüssen
>>
>>  
>>
>> Wolfgang Wagner
>>
>> Systemadministration
>>
>>  
>>
>> RIWA GmbH
>>
>> Gesellschaft für Geoinformationen
>>
>> Zwingerstr. 2, 87435 Kempten
>>
>> E-Mail: wolfgang.wagner at riwa-gis.de
>>
>> http://www.riwa-gis.de
>>
>>  
>>
>> --------------------------------------------------------------------------
>> RIWA GmbH, Zwingerstrasse 2, 87435 Kempten
>> Sitz der Gesellschaft: Kempten (Allgaeu)
>> Registergericht: Amtsgericht Kempten, HRB 6480
>> Geschaeftsfuehrer: Dipl.-Ing. Guenter Kraus
>> --------------------------------------------------------------------------
>>
>>
>>
>> _______________________________________________
>> systemd-devel mailing list
>> systemd-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>>
> 
> Hi,
> 
> just drop a
> ---
> [Unit]
> ReuqiresMountsFor=/mnt/daten/postgis/9.4/main
> ---
> into
> »/etc/systemd/system/postgresql at 9.4-main.service.d/wait-for-mountpoint.conf«
> (create directory and file if necessary) end everything should be fine.
> In your fstab also add »_netfs« and remove »noauto« for your mount
> point. See »man systemd.unit« for more informations on RequireMountsFor=.
> 
> Regards
> 
> 
> 
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 
Oh, and obviously write RequiresMountsFor= in the right way and not with
reversed »q« and »u« or missing »s«.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160701/e96c9ce8/attachment.sig>


More information about the systemd-devel mailing list