Coder Social home page Coder Social logo

Comments (7)

kormoc avatar kormoc commented on August 18, 2024

What distro is this and did you build a package?

from diamond.

Dieterbe avatar Dieterbe commented on August 18, 2024

CentOS release 6.2 (Final), built using make buildrpm using the latest git

from diamond.

kormoc avatar kormoc commented on August 18, 2024

I think 63d28b3 might do the trick, or at least help us track it down

from diamond.

Dieterbe avatar Dieterbe commented on August 18, 2024
$ grep "Failed to write pid." /usr/bin/diamond < -- check to be sure the new package is installed
            print >> sys.stderr, "Failed to write pid." % (e)
$ sudo rm /var/log/diamond/*.log*
$ sudo /etc/init.d/diamond start
Starting diamond: Error occurs when initialize logging: [Errno 13] Permission denied: '/var/log/diamond/diamond.log'
                                                           [  OK  ]
$ pgrep -fl diamond <-- process running? no
$ sudo su -
# touch /var/log/diamond/diamond.log && chown nobody:nobody /var/log/diamond/diamond.log && ls -alh /var/log/diamond/diamond.log
-rw-r--r-- 1 nobody nobody 0 Jul 19 06:29 /var/log/diamond/diamond.log

# /etc/init.d/diamond start
Starting diamond:                                          [  OK  ]
# pgrep -fl diamond <-- still not running
# cd /var/log/diamond/
# ls -alh
total 12K
drwxr-xr-x   2 root   root   4.0K Jul 19 06:29 .
drwxr-xr-x. 12 root   root   4.0K Jul 15 03:26 ..
-rw-r--r--   1 nobody nobody  140 Jul 19 06:29 diamond.log
-rw-r--r--   1 root   root      0 Jul 16 18:30 .keep
# cat diamond.log 
[2012-07-19 06:29:47,920] [MainThread] Changed UID: 99 (nobody) GID: 99 (nobody).
[2012-07-19 06:29:47,920] [MainThread] Detaching Process.

from diamond.

Dieterbe avatar Dieterbe commented on August 18, 2024

running in foreground works. the process runs as nobody:nobody and submits its stats.
in background. note that your "Failed to write pid" check won't work as you're attempting to write to stderr after closing it. so change it to log.error() or something. also you forgot a %s, now your code yields a not all arguments converted during string formatting

btw in /var/log/messages i'm getting these:

Jul 19 06:51:42 nyvimeodfs1 python: abrt: detected unhandled Python exception in /usr/bin/diamond
Jul 19 06:51:42 nyvimeodfs1 abrtd: New client connected
Jul 19 06:51:42 nyvimeodfs1 abrt-server[29092]: Saved Python crash dump of pid 29090 to /var/spool/abrt/pyhook-2012-07-19-06:51:42-29090
Jul 19 06:51:42 nyvimeodfs1 abrtd: Directory 'pyhook-2012-07-19-06:51:42-29090' creation detected
Jul 19 06:51:42 nyvimeodfs1 abrt-server[29092]: statvfs('(null)'): Bad address
Jul 19 06:51:42 nyvimeodfs1 abrtd: Package 'diamond' isn't signed with proper key
Jul 19 06:51:42 nyvimeodfs1 abrtd: Corrupted or bad dump /var/spool/abrt/pyhook-2012-07-19-06:51:42-29090 (res:2), deleting

unfortunately there's nothing in /var/spool/abrt/
Anyway, after fixing the pidfile stderr stuff got:
Failed to write pid: [Errno 13] Permission denied: '/var/run/diamond.pid'
maybe you should first create it as the user invoked as (root), before dropping privileges. not sure...

from diamond.

Dieterbe avatar Dieterbe commented on August 18, 2024

deployed a new rpm built from your personal fork, seems to work fine!

from diamond.

kormoc avatar kormoc commented on August 18, 2024

Awesome!

from diamond.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.