1 month ago

Sudo -s doesn't seem to be working

Posted 1 month ago by matttonks11


I've just deployed a new site to laravel forge and tried to run the deploy script however the script fails because it is asking for the sudo password. Here's the deployment script code

$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader

( flock -w 10 9 || exit 1
    echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock

if [ -f artisan ]; then
    $FORGE_PHP artisan migrate --force

Here's the deployment log

Already up-to-date.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: intervention/image
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: socialiteproviders/manager
Discovered Package: spatie/laravel-medialibrary
Discovered Package: spatie/laravel-permission
Discovered Package: spatie/laravel-tags
Discovered Package: spatie/laravel-translatable
Package manifest generated successfully.
55 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Restarting FPM...
[sudo] password for forge: 

I can't seem to figure out why this is happening. I recently installed php 7.4 on the server so this site is using 7.4, all the other sites are using 7.3 and they deploy fine

Any help would be appreciated

Please sign in or create an account to participate in this conversation.