ttyname failed: Inappropriate ioctl for device #2856
-
Seems the latest deploy failed on
Any ideas how it could fail? Here our yaml file import:
- recipe/laravel.php
- contrib/php-fpm.php
- contrib/npm.php
config:
application: 'site-app'
remote_user: forge
deploy_path: '~/{{hostname}}'
repository: 'git@github.com:app/site-app.git'
php_fpm_version: '8.0'
keep_releases: '10'
shared_files:
- '.env'
- '.transip_private_key'
- 'storage/app/exact.api.json'
shared_dirs:
- 'bootstrap/cache'
- 'public/uploads'
- 'public/published'
- 'storage/framework/cache'
- 'storage/framework/sessions'
- 'storage/framework/views'
- 'storage/logs'
- 'storage/tls'
- 'storage/app/public'
- 'storage/app/modules'
writable_dirs:
- 'public/uploads'
- 'public/published'
- 'storage/framework/cache/data'
- 'storage/logs'
- 'storage/tls'
- 'storage/app/public'
- 'storage/app/modules'
hosts:
prod:
hostname: 'app.com'
staging:
hostname: 'staging.app.com'
tasks:
deploy:
- deploy:prepare
- deploy:vendors
- artisan:storage:link
- artisan:view:cache
- artisan:config:cache
- artisan:optimize
- artisan:migrate
- artisan:queue:restart
- artisan:horizon:terminate
- deploy:publish
after:
deploy:symlink: php-fpm:reload
deploy:failed: deploy:unlock Did see we had # Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
forge ALL = NOPASSWD: /etc/init.d/nginx
forge ALL = NOPASSWD: /etc/init.d/php7.4-fpm restart
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d So updated to 8.0 and reran the script but no success as of yet. Command failureCommand ran from this PHP FPM file in Deployer: ....
## Configuration
- `php_fpm_version` – The PHP-fpm version. For example: `8.0`.
- `php_fpm_service` – The full name of the PHP-fpm service. Defaults to `php{{php_fpm_version}}-fpm`.
- `php_fpm_command` – The command to run to reload PHP-fpm. Defaults to `sudo systemctl reload {{php_fpm_service}}`.
## Usage
Start by explicitely providing the current version of PHP-version using the `php_fpm_version`.
Alternatively, you may use any of the options above to configure how PHP-fpm should reload.
Then, add the `php-fpm:reload` task at the end of your deployments by using the `after` method like so.
php
set('php_fpm_version', '8.0');
after('deploy', 'php-fpm:reload');
*/
namespace Deployer;
set('php_fpm_version', function () {
return run('php -r "printf(\'%d.%d\', PHP_MAJOR_VERSION, PHP_MINOR_VERSION)"');
});
set('php_fpm_service', 'php{{php_fpm_version}}-fpm');
set('php_fpm_command', 'sudo systemctl reload {{php_fpm_service}}');
desc('Reloads the php-fpm service');
task('php-fpm:reload', function () {
warning('Avoid reloading php-fpm [ï.at/avoid-php-fpm-reloading]');
run('{{php_fpm_command}}');
});
... It failed at New Custom Command?I had
for PHP command before. Perhaps we need this |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
I saw script was calling local PHP 7.4
so switched to 8.1 and tried again. It failed. Then I tried with local PHP 8.0. It still failed again as well. Using and we already have cat /root/.profile
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n || true so the possible solution mentioned at https://programmerah.com/linux-error-ttyname-failed-inappropriate-ioctl-for-device-solution-2134/ does not fly either. |
Beta Was this translation helpful? Give feedback.
-
Solved with new
See #2857 |
Beta Was this translation helpful? Give feedback.
-
Avoid reloading php-fpm https://ï.at/avoid-php-fpm-reloading |
Beta Was this translation helpful? Give feedback.
Solved with new
visudo
command for passwordless sudo:See #2857