Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moved daemon log into cache dir so it only has to contend with 1 set …

…of directory permissions. added a conditional check of if is running as root. Will no longer attempt to change the permissions of files unless it is running as root
  • Loading branch information...
commit e06d1edbabaadc193e11589149e47a09e9059ca9 1 parent 867dcbe
@jessegreathouse jessegreathouse authored
View
2  DependencyInjection/CodeMemeDaemonExtension.php
@@ -54,7 +54,7 @@ private function getDefaultConfig($name, $container)
'appName' => $name,
'appDir' => $container->getParameter('kernel.root_dir'),
'appDescription' => 'CodeMeme System Daemon',
- 'logLocation' => $container->getParameter('kernel.logs_dir') . '/' . $container->getParameter('kernel.environment'). '.' . $name . '.daemon.log',
+ 'logLocation' => $container->getParameter('kernel.cache_dir') . '/'. $name . '/' . $container->getParameter('kernel.environment'). '.' . $name . '.daemon.log',
'authorName' => 'CodeMeme',
'authorEmail' => 'symfony2.kernel@127.0.0.1',
'appPidLocation' => $container->getParameter('kernel.cache_dir') . '/'. $name . '/' . $name . '.daemon.pid',
View
18 System/Daemon.php
@@ -1310,14 +1310,16 @@ static protected function _summon()
}
// Change identity. maybe
- $c = self::_changeIdentity(
- self::opt('appRunAsGID'),
- self::opt('appRunAsUID')
- );
- if (false === $c) {
- self::crit('Unable to change identity');
- if (self::opt('appDieOnIdentityCrisis')) {
- self::emerg('Cannot continue after this');
+ if (0 === exec("id -u")) {
+ $c = self::_changeIdentity(
+ self::opt('appRunAsGID'),
+ self::opt('appRunAsUID')
+ );
+ if (false === $c) {
+ self::crit('Unable to change identity');
+ if (self::opt('appDieOnIdentityCrisis')) {
+ self::emerg('Cannot continue after this');
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.