Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't start with root #682

Closed
shijinkui opened this issue Oct 30, 2015 · 3 comments
Closed

can't start with root #682

shijinkui opened this issue Oct 30, 2015 · 3 comments
Labels

Comments

@shijinkui
Copy link

As a side note Fedora/RHEL/Centos family of linux specifies Default requiretty in its /etc/sudoers file. This prevents the default Upstart script from working correctly as it uses sudo to run the application as the daemonUser . Simply disable requiretty to use Upstart or modify the Upstart template. http://www.scala-sbt.org/sbt-native-packager/archetypes/java_server/customize.html

serverLoading in Rpm := ServerLoader.Upstart
daemonUser in Linux := "root"
daemonGroup in Linux := (daemonUser in Linux).value

After install rmp package, i use root to run service start xxx fail, the /etc/init.d/ have no my app.
Is it register the app to the init by default?
who can help..

Linux 2.6.32-573.7.1.el6.x86_64 #1 SMP Tue Sep 22 22:00:00 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

@shijinkui
Copy link
Author


rpm -ivh emr-agent-1.0.28-1.noarch.rpm
warning: emr-agent-1.0.28-1.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID f013ff58: NOKEY
Preparing...                ########################################### [100%]
error: %pre(emr-agent-1.0.28-1.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping emr-agent-1.0.28-1
[root@iZ232ajhhycZ arch]# rpm -ivh emr-agent-1.0.28-1.noarch.rpm
warning: emr-agent-1.0.28-1.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID f013ff58: NOKEY
Preparing...                ########################################### [100%]
error: %pre(emr-agent-1.0.28-1.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping emr-agent-1.0.28-1
[root@iZ232ajhhycZ arch]# rpm -ivvh emr-agent-1.0.28-1.noarch.rpm
D: ============== emr-agent-1.0.28-1.noarch.rpm
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D: loading keyring from rpmdb
D: opening  db environment /var/lib/rpm cdb:mpool:joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
D:  read h#     477 Header sanity check: OK
D: added key gpg-pubkey-c105b9de-4e0fd3a3 to keyring
D: Using legacy gpg-pubkey(s) from rpmdb
D: Expected size:     16991847 = lead(96)+sigs(920)+pad(0)+data(16990831)
D:   Actual size:     16991847
warning: emr-agent-1.0.28-1.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID f013ff58: NOKEY
D: ========== relocations
D:  added binary package [0]
D: found 0 source and 1 binary packages
D: ========== +++ emr-agent-1.0.28-1 noarch/linux 0x0
D: opening  db index       /var/lib/rpm/Basenames rdonly mode=0x0
D:  read h#    1002 Header V3 RSA/SHA1 Signature, key ID c105b9de: OK
D:  Requires: /bin/sh                                       YES (db files)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: config(emr-agent) = 0:1.0.28-1                YES (added provide)
D: opening  db index       /var/lib/rpm/Conflictname rdonly mode=0x0
D: ========== recording tsort relations
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0    0    0    1   +emr-agent-1.0.28-1.noarch
D: installing binary packages
D: closed   db index       /var/lib/rpm/Conflictname
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm
D: opening  db environment /var/lib/rpm cdb:mpool:joinenv
D: opening  db index       /var/lib/rpm/Packages create mode=0x42
D: sanity checking 1 elements
D: opening  db index       /var/lib/rpm/Name create mode=0x42
D: running pre-transaction scripts
D: computing 32 file fingerprints
Preparing...                D: computing file dispositions
D: opening  db index       /var/lib/rpm/Basenames create mode=0x42
D: 0x0000ca01     4096      3823561      1167647 /
########################################### [100%]
D: ========== +++ emr-agent-1.0.28-1 noarch-linux 0x0
D: Expected size:     16991847 = lead(96)+sigs(920)+pad(0)+data(16990831)
D:   Actual size:     16991847
D: emr-agent-1.0.28-1.noarch: Header V4 RSA/SHA1 Signature, key ID f013ff58: NOKEY
D:   install: emr-agent-1.0.28-1 has 32 files, test = 0
D: opening  db index       /var/lib/rpm/Triggername create mode=0x42
D:   install: %pre(emr-agent-1.0.28-1.noarch) scriptlet start
D:   install: %pre(emr-agent-1.0.28-1.noarch)   execv(/bin/sh) pid 17009
+ '[' 1 -eq 1 ']'
+ addGroup root ''
+ group=root
+ gid=
+ '[' -z '' ']'
+ gid_flags=
+ getent group
+ grep -q '^root:'
+ addUser root '' root 'emr-agent user-daemon' /bin/false
+ user=root
+ '[' -z root ']'
+ uid=
+ '[' -z '' ']'
+ uid_flags=
+ group=root
+ descr='emr-agent user-daemon'
+ shell=/bin/false
+ getent passwd
+ grep -q '^root:'
+ '[' -e /etc/sysconfig/emr-agent ']'
+ '[' -n '' ']'
D:   install: waitpid(17009) rc 17009 status 100 secs 0.009
error: %pre(emr-agent-1.0.28-1.noarch) scriptlet failed, exit status 1
error:   install: %pre scriptlet failed (2), skipping emr-agent-1.0.28-1
D: running post-transaction scripts
D: closed   db index       /var/lib/rpm/Triggername
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm
[root@iZ232ajhhycZ arch]# ll install^C
[root@iZ232ajhhycZ arch]# ll /etc/sysconfig/emr-agent
ls: cannot access /etc/sysconfig/emr-agent: No such file or directory

@shijinkui
Copy link
Author

hi, @muuki88, am i use in wrong style?

@muuki88 muuki88 added the rpm label Oct 30, 2015
@muuki88
Copy link
Contributor

muuki88 commented Oct 30, 2015

upstart uses the /etc/init/ folder. I'm not sure what the console output is all about.
You sbt configuration looks good ( besides the fact that you're running stuff as root ;) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants