* [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount @ 2021-07-22 2:51 lixiaokeng 2021-07-22 21:42 ` Benjamin Marzinski 0 siblings, 1 reply; 8+ messages in thread From: lixiaokeng @ 2021-07-22 2:51 UTC (permalink / raw) To: Martin Wilck, Benjamin Marzinski, Christophe Varoqui, dm-devel mailing list Cc: linfeilong, liuzhiqiang (I) When we enable multipathd.service with systemctl and reboot, multipathd doesn't start and log "failed to create pidfile". The reason is following: The RUN is /var/run in multipath-tools. When we start linux, we mount a disk to /var. So if multipathd.service start before mount, it will fail to activate.(If mount firstly, multipathd will start successfully) The RUN is defined in Makefile.inc: ifndef RUN ifeq ($(shell test -L /var/run -o ! -d /var/run && echo 1),1) RUN=run else RUN=var/run endif endif Can it always be defined as run? Regards, Lixiaokeng -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount 2021-07-22 2:51 [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount lixiaokeng @ 2021-07-22 21:42 ` Benjamin Marzinski 2021-07-23 6:27 ` lixiaokeng 0 siblings, 1 reply; 8+ messages in thread From: Benjamin Marzinski @ 2021-07-22 21:42 UTC (permalink / raw) To: lixiaokeng Cc: linfeilong, dm-devel mailing list, Martin Wilck, liuzhiqiang (I) On Thu, Jul 22, 2021 at 10:51:22AM +0800, lixiaokeng wrote: > When we enable multipathd.service with systemctl and reboot, > multipathd doesn't start and log "failed to create pidfile". > > The reason is following: > > The RUN is /var/run in multipath-tools. When we start linux, we > mount a disk to /var. So if multipathd.service start before mount, > it will fail to activate.(If mount firstly, multipathd will start > successfully) > > The RUN is defined in Makefile.inc: > > ifndef RUN > ifeq ($(shell test -L /var/run -o ! -d /var/run && echo 1),1) > RUN=run > else > RUN=var/run > endif > endif > > Can it always be defined as run? I believe all modern distributions make /var/run a symlink to /run. However, if that's the case, then I don't understand why you are running into this issue at all, since multipath should be using /run. What multipath packages are you using? -Ben > > Regards, > Lixiaokeng -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount 2021-07-22 21:42 ` Benjamin Marzinski @ 2021-07-23 6:27 ` lixiaokeng 2021-07-23 16:56 ` Benjamin Marzinski 0 siblings, 1 reply; 8+ messages in thread From: lixiaokeng @ 2021-07-23 6:27 UTC (permalink / raw) To: Benjamin Marzinski Cc: linfeilong, dm-devel mailing list, Martin Wilck, liuzhiqiang (I) On 2021/7/23 5:42, Benjamin Marzinski wrote: > On Thu, Jul 22, 2021 at 10:51:22AM +0800, lixiaokeng wrote: >> When we enable multipathd.service with systemctl and reboot, >> multipathd doesn't start and log "failed to create pidfile". >> >> The reason is following: >> >> The RUN is /var/run in multipath-tools. When we start linux, we >> mount a disk to /var. So if multipathd.service start before mount, >> it will fail to activate.(If mount firstly, multipathd will start >> successfully) >> >> The RUN is defined in Makefile.inc: >> >> ifndef RUN >> ifeq ($(shell test -L /var/run -o ! -d /var/run && echo 1),1) >> RUN=run >> else >> RUN=var/run >> endif >> endif >> >> Can it always be defined as run? > > I believe all modern distributions make /var/run a symlink to /run. > However, if that's the case, then I don't understand why you are running > into this issue at all, since multipath should be using /run. What > multipath packages are you using? Yes, there is a symlink to /run in /var. But it is in the disk (such as sdb) mounted on /var actually. When reboot, systemd start multipathd service firstly then mount sdb to /var. In this way, the multipath service will not start. After sdb mounted to /var, we can start multipathd service successfully. > > -Ben > >> >> Regards, >> Lixiaokeng > > . > -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount 2021-07-23 6:27 ` lixiaokeng @ 2021-07-23 16:56 ` Benjamin Marzinski 2021-07-26 12:22 ` lixiaokeng 0 siblings, 1 reply; 8+ messages in thread From: Benjamin Marzinski @ 2021-07-23 16:56 UTC (permalink / raw) To: lixiaokeng Cc: linfeilong, dm-devel mailing list, Martin Wilck, liuzhiqiang (I) On Fri, Jul 23, 2021 at 02:27:58PM +0800, lixiaokeng wrote: > > > On 2021/7/23 5:42, Benjamin Marzinski wrote: > > On Thu, Jul 22, 2021 at 10:51:22AM +0800, lixiaokeng wrote: > >> When we enable multipathd.service with systemctl and reboot, > >> multipathd doesn't start and log "failed to create pidfile". > >> > >> The reason is following: > >> > >> The RUN is /var/run in multipath-tools. When we start linux, we > >> mount a disk to /var. So if multipathd.service start before mount, > >> it will fail to activate.(If mount firstly, multipathd will start > >> successfully) > >> > >> The RUN is defined in Makefile.inc: > >> > >> ifndef RUN > >> ifeq ($(shell test -L /var/run -o ! -d /var/run && echo 1),1) > >> RUN=run > >> else > >> RUN=var/run > >> endif > >> endif > >> > >> Can it always be defined as run? > > > > I believe all modern distributions make /var/run a symlink to /run. > > However, if that's the case, then I don't understand why you are running > > into this issue at all, since multipath should be using /run. What > > multipath packages are you using? > Yes, there is a symlink to /run in /var. But it is in the disk (such as > sdb) mounted on /var actually. When reboot, systemd start multipathd > service firstly then mount sdb to /var. In this way, the multipath > service will not start. > > After sdb mounted to /var, we can start multipathd service successfully. But when the binaries were compiled, if /var/run existed and was a symlink in your build environment, then RUN should equal "run", and multipath should should be using /run instead of /var/run, right? This is why I asked what multipath packages are you using. -Ben > > > > -Ben > > > >> > >> Regards, > >> Lixiaokeng > > > > . > > -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount 2021-07-23 16:56 ` Benjamin Marzinski @ 2021-07-26 12:22 ` lixiaokeng 2021-07-26 16:28 ` Benjamin Marzinski 0 siblings, 1 reply; 8+ messages in thread From: lixiaokeng @ 2021-07-26 12:22 UTC (permalink / raw) To: Benjamin Marzinski Cc: linfeilong, dm-devel mailing list, Martin Wilck, liuzhiqiang (I) >> After sdb mounted to /var, we can start multipathd service successfully. > > But when the binaries were compiled, if /var/run existed and was a > symlink in your build environment, then RUN should equal "run", and > multipath should should be using /run instead of /var/run, right? > > This is why I asked what multipath packages are you using. > This problem is found in 0.7.7. Regards, Lixiaokeng -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount 2021-07-26 12:22 ` lixiaokeng @ 2021-07-26 16:28 ` Benjamin Marzinski 2021-08-12 11:09 ` Martin Wilck 0 siblings, 1 reply; 8+ messages in thread From: Benjamin Marzinski @ 2021-07-26 16:28 UTC (permalink / raw) To: lixiaokeng Cc: linfeilong, dm-devel mailing list, Martin Wilck, liuzhiqiang (I) On Mon, Jul 26, 2021 at 08:22:49PM +0800, lixiaokeng wrote: > > >> After sdb mounted to /var, we can start multipathd service successfully. > > > > But when the binaries were compiled, if /var/run existed and was a > > symlink in your build environment, then RUN should equal "run", and > > multipath should should be using /run instead of /var/run, right? > > > > This is why I asked what multipath packages are you using. > > > This problem is found in 0.7.7. Sorry. I wasn't very clear with what I was asking for. Unless I'm missing something here, if multipathd is trying to use /var/run, that means that when the multipathd binary was compiled, it was compiled on a machine where /var/run was not a symlink. So, I'm wondering where your multipathd binary got compiled. Are you using a packaged version from a distribution like RHEL, SLES, Fedora, Ubuntu, etc? Did you compile it yourself? When I run multipathd under strace, I can see: openat(AT_FDCWD, "/run/multipathd.pid", O_WRONLY|O_CREAT, 0644) = 3 The multipathd binary I'm using was compiled on a machine where /var/run is a symlink to /run, so multipathd directly uses /run, instead of using /var/run. I'm assuming that whatever machine your multipathd binary was compiled on, /var/run was a directory. Do you know if that's possible? -Ben > > Regards, Lixiaokeng -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount 2021-07-26 16:28 ` Benjamin Marzinski @ 2021-08-12 11:09 ` Martin Wilck 2021-08-12 12:42 ` lixiaokeng 0 siblings, 1 reply; 8+ messages in thread From: Martin Wilck @ 2021-08-12 11:09 UTC (permalink / raw) To: Benjamin Marzinski, lixiaokeng Cc: dm-devel, list, liuzhiqiang (I), linfeilong On Mo, 2021-07-26 at 11:28 -0500, Benjamin Marzinski wrote: > On Mon, Jul 26, 2021 at 08:22:49PM +0800, lixiaokeng wrote: > > > > > > After sdb mounted to /var, we can start multipathd service > > > > successfully. > > > > > > But when the binaries were compiled, if /var/run existed and was > > > a > > > symlink in your build environment, then RUN should equal "run", > > > and > > > multipath should should be using /run instead of /var/run, right? > > > > > > This is why I asked what multipath packages are you using. > > > > > This problem is found in 0.7.7. > > Sorry. I wasn't very clear with what I was asking for. Unless I'm > missing something here, if multipathd is trying to use /var/run, that > means that when the multipathd binary was compiled, it was compiled > on a > machine where /var/run was not a symlink. > > So, I'm wondering where your multipathd binary got compiled. Are you > using a packaged version from a distribution like RHEL, SLES, Fedora, > Ubuntu, etc? Did you compile it yourself? > > When I run multipathd under strace, I can see: > > openat(AT_FDCWD, "/run/multipathd.pid", O_WRONLY|O_CREAT, 0644) = 3 > > The multipathd binary I'm using was compiled on a machine where > /var/run > is a symlink to /run, so multipathd directly uses /run, instead of > using > /var/run. I'm assuming that whatever machine your multipathd binary > was > compiled on, /var/run was a directory. Do you know if that's > possible? Ack. Lixiaokeng, can you answer Ben's question? Regards, Martin -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount 2021-08-12 11:09 ` Martin Wilck @ 2021-08-12 12:42 ` lixiaokeng 0 siblings, 0 replies; 8+ messages in thread From: lixiaokeng @ 2021-08-12 12:42 UTC (permalink / raw) To: Martin Wilck, Benjamin Marzinski Cc: linfeilong, dm-devel mailing list, liuzhiqiang (I) On 2021/8/12 19:09, Martin Wilck wrote: > On Mo, 2021-07-26 at 11:28 -0500, Benjamin Marzinski wrote: >> On Mon, Jul 26, 2021 at 08:22:49PM +0800, lixiaokeng wrote: >>> >>>>> After sdb mounted to /var, we can start multipathd service >>>>> successfully. >>>> >>>> But when the binaries were compiled, if /var/run existed and was >>>> a >>>> symlink in your build environment, then RUN should equal "run", >>>> and >>>> multipath should should be using /run instead of /var/run, right? >>>> >>>> This is why I asked what multipath packages are you using. >>>> >>> This problem is found in 0.7.7. >> >> Sorry. I wasn't very clear with what I was asking for. Unless I'm >> missing something here, if multipathd is trying to use /var/run, that >> means that when the multipathd binary was compiled, it was compiled >> on a >> machine where /var/run was not a symlink. >> >> So, I'm wondering where your multipathd binary got compiled. Are you >> using a packaged version from a distribution like RHEL, SLES, Fedora, >> Ubuntu, etc? Did you compile it yourself? >> >> When I run multipathd under strace, I can see: >> >> openat(AT_FDCWD, "/run/multipathd.pid", O_WRONLY|O_CREAT, 0644) = 3 >> >> The multipathd binary I'm using was compiled on a machine where >> /var/run >> is a symlink to /run, so multipathd directly uses /run, instead of >> using >> /var/run. I'm assuming that whatever machine your multipathd binary >> was >> compiled on, /var/run was a directory. Do you know if that's >> possible? > > Ack. Lixiaokeng, can you answer Ben's question? > > Regards, > Martin > Hi Martin, Ben: I'm sorry for missing reply. The situation is the same as ben said. The /var/run in compile machine is a directory, but it is a symlink in using machine. Thanks Ben's help again. Regards, Lixiaokeng -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-08-12 12:52 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-07-22 2:51 [dm-devel] [Question] multipathd.service start failed when /var/run isn't mount lixiaokeng 2021-07-22 21:42 ` Benjamin Marzinski 2021-07-23 6:27 ` lixiaokeng 2021-07-23 16:56 ` Benjamin Marzinski 2021-07-26 12:22 ` lixiaokeng 2021-07-26 16:28 ` Benjamin Marzinski 2021-08-12 11:09 ` Martin Wilck 2021-08-12 12:42 ` lixiaokeng
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).