Letractively / rubycas-server

Automatically exported from code.google.com/p/rubycas-server
GNU Lesser General Public License v2.1
0 stars 0 forks source link

PID file is always empty and rubycas-server-ctl will not start RubyCas Server with empty PID file #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. rubycas-server -d -P /etc/rubycas-server/rubycas-server.pid
 or  
2. sudo /usr/bin/rubycas-server-ctl start --verbose

What is the expected output? What do you see instead?

The rubycas-server script (Picnic) creates the PID file in the correct
location only everytime it is empty.

Here is the output.  This may be a Picnic thing but I am not sure.  If the
PID file is empty the RubyCas server can't be started using the
rubycas-server-ctl script and therefore can't be run as using the init.d
script provided.  What can I do to populate the PID file with the proper
value?  Also, it appears that rubycas-server-ctl stop isn't removing the
pid file either.

Output:
nbrowning@nicky:~$ sudo /usr/bin/rubycas-server-ctl start --verbose
Starting rubycas-server...
<<< rubycas-server -d -P /etc/rubycas-server/rubycas-server.pid
>>> Using pid file '/etc/rubycas-server/rubycas-server.pid'
Adding Picnic functionality to CASServer from
/usr/lib/ruby/gems/1.8/gems/picnic-0.7.1/lib...
Loading configuration for CASServer from '/etc/rubycas-server/config.yml'...
Initializing CASServer logger...

Starting with configuration: --- !map:HashWithIndifferentAccess 
ticket_granting_ticket_expiry: 172800
expire_sessions: false
proxy_granting_ticket_expiry: 172800
authenticator: !map:HashWithIndifferentAccess 
  ldap: !map:HashWithIndifferentAccess 
    auth_user: cn=admin,dc=nbrowning,dc=com
    port: 636
    filter: (objectClass=person)
    auth_password: secret
    username_attribute: uid
    host: 127.0.0.1
    base: dc=nbrowning,dc=com
  class: CASServer::Authenticators::LDAP
ssl_key: /etc/apache2/ssl/login.nbrowning.com/server.key
ssl_cert: /etc/apache2/ssl/login.nbrowning.com/server.crt
infoline: Powered by <a
href="http://code.google.com/p/rubycas-server/">RubyCAS-Server</a>
theme: simple
log: !map:HashWithIndifferentAccess 
  level: DEBUG
  file: /var/www/login.nbrowning.com/logs/casserver.log
public_dir: !map:HashWithIndifferentAccess 
  dir: /usr/lib/ruby/gems/1.8/gems/rubycas-server-0.7.1/lib/themes
  path: /themes
login_ticket_expiry: 300
port: 8100
service_ticket_expiry: 300
uri_path: /
server: mongrel
organization: CAS
database: !map:HashWithIndifferentAccess 
  username: root
  adapter: mysql
  host: localhost
  password: 
  database: casserver

** CASServer is starting. Look in
"/var/www/login.nbrowning.com/logs/casserver.log" for further notices.
>>> STATE: empty_pid

rubycas-server could not start properly!
Try running with the --verbose option for details.
nbrowning@nicky:~$ 

Thank you very much.

Original issue reported on code.google.com by nick.bro...@gmail.com on 30 Dec 2008 at 2:28

GoogleCodeExporter commented 8 years ago
Have you tried starting it without the -P option? Does it work then? Is the pid 
file
and directory writable?

Also can you provide some more details about your platform? It looks like 
Linux, but
which distribution? Or maybe it's BSD?

I haven't run into this problem before, so we'll have to dig around a bit.

Original comment by matt.zuk...@gmail.com on 30 Dec 2008 at 3:29

GoogleCodeExporter commented 8 years ago
Thank you very much for getting back to me so quickly.  I'm using Ubuntu Hardy 
Heron.  

The directory '/etc/rubycas-server' is writable and in fact, the PID file is 
being
written.  However, there is no pid value in the file, only an empty file.

nbrowning@nicky:/etc$ ls -al | grep rubycas-server
drwxr-xr-x   2 root root      4096 2008-12-30 09:30 rubycas-server

Incidentially, I have tried changing the directory permissions to 777 with no
positive result.

I have tried the following:

Running the following doesn't start the process but creates an empty pid file 
(in the
default location).

sudo /usr/bin/rubycas-server-ctl start

The below starts the process and creates an empty pid file (in the default 
location).

sudo /usr/bin/rubycas-server

It looks as if Picnic controls the startup and shutdown part and I have poked 
around
and can't find the code that puts the process id into the pid file.  Let me 
know if
there is any other info you need.  Thank you again.

Original comment by nick.bro...@gmail.com on 31 Dec 2008 at 2:22

GoogleCodeExporter commented 8 years ago
Need to check if this is still happening in Picnic 0.8.0... it may have been
inadvertently fixed.

Original comment by matt.zuk...@gmail.com on 12 Mar 2009 at 3:11

GoogleCodeExporter commented 8 years ago
I have the same kind of problem here, I get the following output (on ubuntu 
hardy)
while trying to run rubycas-server-ctl start --verbose:
##############################################################
Starting rubycas-server...
<<< rubycas-server -d -P /etc/rubycas-server/rubycas-server.pid
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no 
such
file to load -- active_record (LoadError)
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from
/var/lib/gems/1.8/gems/rubycas-server-0.7.1.1/lib/casserver/environment.rb:12
        from /var/lib/gems/1.8/gems/rubycas-server-0.7.1.1/lib/casserver.rb:6:in `load'
        from /var/lib/gems/1.8/gems/rubycas-server-0.7.1.1/lib/casserver.rb:6
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `require'
        from /var/lib/gems/1.8/gems/rubycas-server-0.7.1.1/lib/rubycas-server.rb:1
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /var/lib/gems/1.8/gems/picnic-0.7.0.98/lib/picnic/cli.rb:117:in
`handle_cli_input'
        from /var/lib/gems/1.8/gems/rubycas-server-0.7.1.1/bin/rubycas-server:25
        from /bin/rubycas-server:16:in `load'
        from /bin/rubycas-server:16
>>> Using pid file '/etc/rubycas-server/rubycas-server.pid'
>>> STATE: missing_pid

rubycas-server could not start properly!
Try running with the --verbose option for details.
#############################################################
The pid file doesn't exist (the directory in /etc was'nt existing neither, I 
needed
to create it). If I touch it it is deleted when running rubycas-server so this
probably means it is in the good place and the permissions on it are good 
(which is
obviously the case 'cause I have chmoded 777 both the file and directory).

Original comment by jon207@gmail.com on 27 Apr 2009 at 1:19

GoogleCodeExporter commented 8 years ago
try grabbing the latest version from github:

  gem sources -a http://gems.github.com
  sudo gem install gunark-rubycas-server

Original comment by matt.zuk...@gmail.com on 27 Apr 2009 at 10:43

GoogleCodeExporter commented 8 years ago
I can't install the version from github, it seems there is a circular dependency
between rack and thin that made install impossible.

Original comment by jon207@gmail.com on 28 Apr 2009 at 9:20

GoogleCodeExporter commented 8 years ago
I'm also experiencing this problem. Once I start the process with 
`rubycas-server-ctl
start` the PID file is empty. I cannot kill the process with anything. I've even
tried `kill <pid>` while getting the pid with `ps -aux` and it doesn't work
strangely. When I reboot the server the PID file is still there and still 
empty, so
when I manually start the server again, it says the PID file exists and it 
deletes
and recreates it, still empty. Basically, I have to reboot the server every 
time i
change something in the config.yml file! Any thoughts? (yes, I installed it 
from github)

Original comment by pho3nixf1re84 on 29 Sep 2009 at 4:14

GoogleCodeExporter commented 8 years ago
Have you tried killing the server with `kill -9 <pid>`?

Original comment by matt.zuk...@gmail.com on 29 Sep 2009 at 8:06

GoogleCodeExporter commented 8 years ago
No I didn't. However, I gave up and decided to try passenger, although I really
prefer to only use that when I'm deploying a ruby webapp in a mixed environment,
otherwise i always use an nginx reverse proxy. My only problem so far with 
passenger
is that it refuses to read my sqlite database. *sigh I su'd as www-data to make 
sure
it worked and it does have full access to the db file. Unfortunately passenger 
still
give me the can't open database.

Original comment by pho3nixf1re84 on 29 Sep 2009 at 8:31

GoogleCodeExporter commented 8 years ago
Scratch that, some permissions got screwed up, been a long day I guess. Its 
working
"fine" on passenger. This must be a problem with running off webrick/mongrel.

Original comment by pho3nixf1re84 on 29 Sep 2009 at 9:15