Which user does deploy run as?

General discussion forum for the Zend Server

Which user does deploy run as?

Postby crazymerlin on Wed May 25, 2016 9:43 pm

I ask because I have a postActivate script which I don't believe is being run.

The script is very simple with a couple of chmods and a link:

Code: Select all
echo `chmod -R 0777 ` . ZS_CURRENT_APP_VERSION . `/storage`;
echo `chmod -R 0777 ` . ZS_CURRENT_APP_VERSION . `/bootstrap/cache`;
echo `ln -sf ` . ZS_CURRENT_APP_VERSION . `/ ./current`;


I assume the user is zend
crazymerlin
 
Posts: 243
Joined: Wed Feb 18, 2009 10:25 pm
Location: Beaverton, OR, USA

Re: Which user does deploy run as?

Postby crazymerlin on Wed May 25, 2016 10:47 pm

Just to check, I also added the same code to the postStage script, with a sudo -S and password piped in, but again nothing executes
crazymerlin
 
Posts: 243
Joined: Wed Feb 18, 2009 10:25 pm
Location: Beaverton, OR, USA

Re: Which user does deploy run as?

Postby crazymerlin on Thu May 26, 2016 12:35 am

OK, this is getting stupid now:

In my post_stage.php file, I noticed that I was incorrectly using ZS_CURRENT_APP_VERSION as a constant, but the comments state:
The following environment variables are accessable to the script


...ok, silly me!

But then I decided to check and ran this from my postStage script:

Code: Select all
error_log(print_r($_ENV, true));


and in my error log I get the following:
[25-May-2016 16:30:46 America/Creston] Array
(
)


So the $_ENV array is empty? Then why the comment in the file?
Come on Zend, help me out here FFS!
crazymerlin
 
Posts: 243
Joined: Wed Feb 18, 2009 10:25 pm
Location: Beaverton, OR, USA

Re: Which user does deploy run as?

Postby crazymerlin on Thu May 26, 2016 2:13 am

Finally...with a little trial and error:

Code: Select all
$env_dir = getenv('ZS_APPLICATION_BASE_DIR') . '/';
$writables = [
    $env_dir . 'storage',
    $env_dir . 'storage/logs',
    $env_dir . 'storage/logs/laravel.log',
    $env_dir . 'storage/framework/views',
    $env_dir . 'storage/framework/sessions',
    $env_dir . 'storage/framework/cache',
    $env_dir . 'bootstrap/cache'
];

foreach($writables as $writable) {
    chmod($writable, 0777);
}
crazymerlin
 
Posts: 243
Joined: Wed Feb 18, 2009 10:25 pm
Location: Beaverton, OR, USA


Return to Zend Server

Who is online

Users browsing this forum: No registered users and 4 guests