Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: xtxb on September 10, 2017, 08:23:38 PM

Title: How can i auto execute shell ofter booted and autologin as user 'TC'
Post by: xtxb on September 10, 2017, 08:23:38 PM
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 !
Title: Re: How can i auto execute shell ofter booted and autologin as user 'TC'
Post by: Rich 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.
Title: Re: How can i auto execute shell ofter booted and autologin as user 'TC'
Post by: xtxb 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?
Title: Re: How can i auto execute shell ofter booted and autologin as user 'TC'
Post by: polikuo 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
Title: Re: How can i auto execute shell ofter booted and autologin as user 'TC'
Post by: xtxb 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 !