<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic power up script as user in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/power-up-script-as-user/m-p/1012229#M149909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to create a service that launches a script on power up. The script lives in the \home\root directory and this works to subsequently launch my application (./zzz.out). This does indeed work except if I want to display a window on my monitor. If I log in as root and launch the script it does show the window.&lt;/P&gt;&lt;P&gt;the script looks like:&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;BR /&gt;cd $(dirname $0)&lt;BR /&gt;./zzz.out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to modify the script so it launches the app as the root user so I can see the window without actually manually logging in?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Nov 2019 21:45:04 GMT</pubDate>
    <dc:creator>davidvescovi</dc:creator>
    <dc:date>2019-11-19T21:45:04Z</dc:date>
    <item>
      <title>power up script as user</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/power-up-script-as-user/m-p/1012229#M149909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to create a service that launches a script on power up. The script lives in the \home\root directory and this works to subsequently launch my application (./zzz.out). This does indeed work except if I want to display a window on my monitor. If I log in as root and launch the script it does show the window.&lt;/P&gt;&lt;P&gt;the script looks like:&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;BR /&gt;cd $(dirname $0)&lt;BR /&gt;./zzz.out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to modify the script so it launches the app as the root user so I can see the window without actually manually logging in?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2019 21:45:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/power-up-script-as-user/m-p/1012229#M149909</guid>
      <dc:creator>davidvescovi</dc:creator>
      <dc:date>2019-11-19T21:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: power up script as user</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/power-up-script-as-user/m-p/1012230#M149910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can add starting your application into /etc/rc.local file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternativelly you can place your script into /etc/init.d&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;root@imx8qmmek:/etc/init.d# cat test.sh&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;echo test &amp;gt; /file.txt&lt;BR /&gt;root@imx8qmmek:/etc/init.d# ls -l test.sh&lt;BR /&gt;-rwxr-xr-x 1 root root 22 May 25 18:50 test.sh&lt;BR /&gt;root@imx8qmmek:/etc/init.d#&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and add it into exact runlevel:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;root@imx8qmmek:/etc/init.d# runlevel&lt;BR /&gt;N 3&lt;BR /&gt;root@imx8qmmek:/etc/init.d# cd /etc/rc3.d/&lt;BR /&gt;root@imx8qmmek:/etc/rc3.d# ln -s ../init.d/test.sh S50test.sh&lt;BR /&gt;root@imx8qmmek:/etc/rc3.d#&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it what you are asking for?&lt;BR /&gt;Or you need the script to run as some user other than root?&lt;BR /&gt;In this case you can use "su" command in the script and point exact user.&lt;BR /&gt;I mean something like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# su the_user -c /path/to/the/command&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2019 02:45:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/power-up-script-as-user/m-p/1012230#M149910</guid>
      <dc:creator>b36401</dc:creator>
      <dc:date>2019-11-20T02:45:47Z</dc:date>
    </item>
  </channel>
</rss>

