[Discuss] systemd race condition problems

Jerry Feldman gaf at blu.org
Sat Aug 30 10:26:46 EDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Before we moved our office from Newton, we were using ypbind, and found
that on startup some systems would not come up properly. The solution
was the timeout with ypbind. We've been using ldap with an Ottawa based
ldap server and a Toronto-based repeater and we have had relatively few
issues.

On 08/30/2014 09:29 AM, Stephen Adler wrote:
> On 08/30/2014 08:27 AM, Stephen Adler wrote:
>> Hi All,
>>
>> I'm having trouble with httpd and my subversion repository setup. I'm
using mod_dav_svn apache module to access my repository through httpd.
So here's the rub. I have everything configured and when I go to update
a file, I get an error that a particular file is not readable.
(permission denied)
>>
>> [Sat Aug 30 08:05:27.432294 2014] [:error] [pid 2063] (20014)Internal
error: [client 71.163.254.54:49330] Can't open file
'/export/telacode/base/SVNRepositories/TelaCodeRepository/format':
Permission denied
>>
>>
>> The odd bit is the file is world readable.
>>
>> [root at telacode ~]# ls -l
/export/telacode/base/SVNRepositories/TelaCodeRepository/format
>> -r--r--r--. 1 softadmin telacoderepository 2 Feb 12  2007
/export/telacode/base/SVNRepositories/TelaCodeRepository/format
>>
>>
>> The solution to my problem is to restart apache with the command
'apachectl restart'. Then I can update my repository through the http
mod_dav_svn.
>>
>> The file system is located on a raid 5 array
>>
>> [root at telacode ~]# df /export
>> Filesystem      1K-blocks      Used  Available Use% Mounted on
>> /dev/md3       1892209456 129889412 1664627680   8% /export
>>
>> and I'm thinking that the process which mounts/activates the file
system is slower than the apache service startup process. (rhel 7 now
uses systemd instead of sysVinit).
>>
>> So, any ideas on how to delay apache startup so that it is guaranteed
to start after the /export file system is fully mounted and available to
the system?
>>
>> Thanks. Steve.
>> _______________________________________________
>> Discuss mailing list
>> Discuss at blu.org
>> http://lists.blu.org/mailman/listinfo/discuss
>>
>
> Answering my own question.... I learned about 'systemd-analyze plot'.
>From this nice graphical display of the startup process, I realized that
my ypbind.service was taking a bit of time. (I'm working on migrating to
LDAP at some later point...) Since there are a lot of permission issues
set through ypbind, I thought it best to delay staring up apache until
after the ypbind service was working. Thus all it took was to add
ypbind.service to /usr/lib/systemd/system/httpd.service file in the
'After' tag list.
>
> -------- cat /usr/lib/systemd/system/httpd.service  ------
>
> [Unit]
> Description=The Apache HTTP Server
> After=network.target remote-fs.target nss-lookup.target ypbind.service
>
> [Service]
> Type=notify
> EnvironmentFile=/etc/sysconfig/httpd
> ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
> ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
> ExecStop=/bin/kill -WINCH ${MAINPID}
> # We want systemd to give httpd some time to finish gracefully, but
still want
> # it to kill httpd after TimeoutStopSec if something went wrong during the
> # graceful stop. Normally, Systemd sends SIGTERM signal right after the
> # ExecStop, which would kill httpd. We are sending useless SIGCONT
here to give
> # httpd time to finish.
> KillSignal=SIGCONT
> PrivateTmp=true
>
> [Install]
> WantedBy=multi-user.target
>
> -----------------------------
>
> and now after a fresh reboot, my subversion repository access through
httpd seems to be working again.
>
> Cheers. Steve.
>
> _______________________________________________
> Discuss mailing list
> Discuss at blu.org
> http://lists.blu.org/mailman/listinfo/discuss
>
>

- -- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix
PGP key id:3BC1EB90
PGP Key fingerprint: 49E2 C52A FC5A A31F 8D66  C0AF 7CEA 30FC 3BC1 EB90
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEVAwUBVAHfJnzqMPw7weuQAQJ2YwgAs7Lzr4UUehFlA1Kv+ZfnWYtZSyN50HZS
4rEKqwnw41NUIUG6dRIcGOvgU5x1azr1ugImXn00slhSCu91JuECrP1s7zXn8oBA
nHgs3XbWUDgGdeoKSNAS5P5rrOFLEEZ0SpiKPONl/ZhSHyIWSaOt6mjRgOHqCPsV
Q2YOvRyTgr5HDPgOJ3jC0LoaD0ShX4hyUPFvDJdntmD+68Hnj9cTzvvnXxRY945U
dsNajpTDWCN9JQyZNzkYWU4h85/PDlRGga/XG1ATwNSTVxXgUjmDE/Q8CCbNs6De
uEsXEzp7BaWI5uNLJosBVNATQe8yFYrkmP8CpNLN8AkMSGV5mxB6dA==
=s+nF
-----END PGP SIGNATURE-----




More information about the Discuss mailing list