WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How can i auto execute shell ofter booted and autologin as user 'TC'  (Read 1871 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: 11213
Re: How can i auto execute shell ofter booted and autologin as user 'TC'
« Reply #1 on: September 10, 2017, 09:06:29 PM »
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 10, 2017, 10:10:57 PM »
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 10, 2017, 10:12:29 PM by xtxb »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 714
Re: How can i auto execute shell ofter booted and autologin as user 'TC'
« Reply #3 on: September 10, 2017, 10:34:58 PM »
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 10, 2017, 11:36:16 PM »
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 !