FastCGI Perl, NGNIX, insserv and “This account is currently not available.”

Posted by on Mar 05 2020, in kraxn

I have local perl script that runs on FastCGI. Recently my Ubuntu machine died and I have been systematically reinstalling the old scripts. This script came from the following tuturial: https://nginxlibrary.com/perl-fastcgi/

Unfortunately, I got stuck when it got to this part:

insserv perl-fcgi

There do not seem to be any more packages for insserv:

sudo apt-get install insserv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package insserv

by jumping heading and trying to start init.d without it, it got this error:

sudo /etc/init.d/perl-fcgi start
This account is currently not available.

Looking around I found the solution was modifiying the etc/passwd file. While I am not sure if this kosher for live production website, it worked for me:

Unfortunately when I got to the "/etc/init.d/perl-fcgi start" step, I ran into 
the same problem, i.e. "This account is currently not available.". I temporarily 
worked around it by changing the www-data's shell in /etc/passwd from 
"/usr/sbin/nologin" to "/usr/bash", and although that allowed me to serve 
Perl webpages..

In my case I commented out the www-data user like so and everything worked.

#www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
# added this as to get local fcgi to work with nginx
www-data:x:33:33:www-data:/var/www:/bin/bash