WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How can i auto execute shell ofter booted and autologin as user 'TC'  (Read 2259 times)

Offline xtxb

  • Newbie
  • *
  • Posts: 7
How can i auto execute shell ofter booted and autologin as user 'TC'?
I create:  /proc/bootlocal.sh  , the content is :

expect /opt/chpd.exp
sudo dmidecode |grep 'Serial Number' >/tmp/ggg.txt
curl -o POST  http://192.168.26.180:38060/csa/v/info?value=XXX

the secend line can't run , display : Don't run this as root
why?  please help !

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11702
Re: How can i auto execute shell ofter booted and autologin as user 'TC'
« Reply #1 on: September 11, 2017, 12:06:29 AM »
Hi xtxb
Quote
the secend line can't run , display : Don't run this as root
Sounds like it doesn't like you using  sudo.

Offline xtxb

  • Newbie
  • *
  • Posts: 7
Re: How can i auto execute shell ofter booted and autologin as user 'TC'
« Reply #2 on: September 11, 2017, 01:10:57 AM »
Hi xtxb
Quote
the secend line can't run , display : Don't run this as root
Sounds like it doesn't like you using  sudo.

tinycore autologin as user 'TC' ,but the command 'dmidecode' must run with 'root', so ,i use 'sodu' , has anyother way?
« Last Edit: September 11, 2017, 01:12:29 AM by xtxb »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 758
Re: How can i auto execute shell ofter booted and autologin as user 'TC'
« Reply #3 on: September 11, 2017, 01:34:58 AM »
How can i auto execute shell ofter booted and autologin as user 'TC'?
I create:  /proc/bootlocal.sh  , the content is :
Do you mean /opt/bootlocal.sh ?
If so, it is already executed as root.
If you want to change the user name, try the bootcode user="TC"

Quote
expect /opt/chpd.exp
sudo dmidecode |grep 'Serial Number' >/tmp/ggg.txt
curl -o POST  http://192.168.26.180:38060/csa/v/info?value=XXX

the secend line can't run , display : Don't run this as root
why?  please help !

Are you sure it's the second line ?
Mine looks fine.
Code: [Select]
tc@box:~$ sudo dmidecode | grep 'Serial Number'
        Serial Number: MB-1234567890
        Serial Number: MT7096K00700531
        Serial Number: Chassis Serial Number
        Serial Number: To Be Filled By O.E.M.
        Serial Number: SerNum0
        Serial Number: SerNum1
        Serial Number: SerNum2
        Serial Number: SerNum3

Offline xtxb

  • Newbie
  • *
  • Posts: 7
Re: How can i auto execute shell ofter booted and autologin as user 'TC'
« Reply #4 on: September 11, 2017, 02:36:16 AM »
How can i auto execute shell ofter booted and autologin as user 'TC'?
I create:  /proc/bootlocal.sh  , the content is :
Do you mean /opt/bootlocal.sh ?
If so, it is already executed as root.
If you want to change the user name, try the bootcode user="TC"

Quote
expect /opt/chpd.exp
sudo dmidecode |grep 'Serial Number' >/tmp/ggg.txt
curl -o POST  http://192.168.26.180:38060/csa/v/info?value=XXX

the secend line can't run , display : Don't run this as root
why?  please help !

Are you sure it's the second line ?
Mine looks fine.
Code: [Select]
tc@box:~$ sudo dmidecode | grep 'Serial Number'
        Serial Number: MB-1234567890
        Serial Number: MT7096K00700531
        Serial Number: Chassis Serial Number
        Serial Number: To Be Filled By O.E.M.
        Serial Number: SerNum0
        Serial Number: SerNum1
        Serial Number: SerNum2
        Serial Number: SerNum3
Sorry,i do that with wrong。There's no problem now,but thanks !