From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5096A7AB.3020508@xenomai.org> Date: Sun, 04 Nov 2012 18:36:43 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <9d3ef55df641c8657ce09c6f6e023e4a.squirrel@www.xenomai.org> <2b4941d6b09c5560d4074bc644ded41d.squirrel@www.xenomai.org> <50958A57.8010902@xenomai.org> <50958DD4.1000702@xenomai.org> <50969840.5010705@xenomai.org> <5096A058.30204@xenomai.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] rt_task_create fails when running over ssh List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrey Nechypurenko Cc: xenomai@xenomai.org On 11/04/2012 06:14 PM, Andrey Nechypurenko wrote: > On 4 November 2012 18:05, Gilles Chanteperdrix > wrote: >> On 11/04/2012 05:43 PM, Andrey Nechypurenko wrote: >> >>> On 4 November 2012 17:30, Gilles Chanteperdrix >>> wrote: >>>> On 11/04/2012 05:13 PM, Andrey Nechypurenko wrote: >>>> >>>>> On 3 November 2012 22:34, Gilles Chanteperdrix >>>>> wrote: >>>>>> On 11/03/2012 10:32 PM, Andrey Nechypurenko wrote: >>>>>> >>>>>>>> Use the DESTDIR environment variable (you can look inside xeno-config to >>>>>>>> see how it works, it should be pretty obvious). >>>>>>> >>>>>>> Thanks for the hint. I'll definitely try. However I doubt that it >>>>>>> would solve the issue with rt_task_create() since I were actually >>>>>>> copy-pasting the output from xeno-config and only change the -I and -L >>>>>>> flags to reflect my directory structure. >>>>>> >>>>>> >>>>>> Yes, I also doubt that very much. What about the arm/thumb issue? >>>>> >>>>> I've run strace and found the following line in the output when >>>>> starting the programm over ssh: >>>>> sched_setscheduler(440, SCHED_FIFO, { 99 }) = -1 EPERM (Operation not permitted) >>>>> I assume, that this call is the part of rt_task_create(). In contrast, >>>>> the same call gets no errors if running in the serial console. Really >>>>> strange to me. >>>>> >>>>> My attempts to change corresponding priorities with ulimit command or >>>>> setrlimit() function does not solve the issue. So it seams like ssh >>>>> server limits some permissions somehow which causes rt_task_create() >>>>> to fail. >>> >>>> Did you check if your compiler compiles thumb code or arm code by default? >>> >>> objdump says: file format elf32-littlearm >>> and file says: ELF 32-bit LSB executable, ARM, version 1 (SYSV) >> >> >> The result is the same with thumb code. In order to know if a binary is >> thumb or arm, run objdump and check if the binary contains 16 bits >> instructions. >> >>> >>>> You can run ulimit to check the current limits. >>>> And it would be interesting to run the "whoami" command or use getuid() >>>> in the program to check whether you are really running as the root user. >>> >>> $ ulimit -a >> >> >> What about whoami or id (it would be nice if did not have to ask the >> same questions 3 times)? > > From my *previous* post: > > printf("User id: %i\n", getuid()); <<<<<<<<< ist it what you were asking for? > getrlimit(RLIMIT_RTPRIO, &resource_limit); > printf("Previous limits: soft=%lld; hard=%lld\n", > (long long) resource_limit.rlim_cur, (long long) > resource_limit.rlim_max); > > The output is: > > User id: 0 <<<<<<<<<<<<<<<<<<<<< ist it what you were asking for? > Previous limits: soft=0; hard=0 > Max FIFO priority is: 99 . > Setting max limit to 99 Yes, in an obfuscated way. > > As I found here: https://bugzilla.redhat.com/show_bug.cgi?id=655321 > ---- > In the meantime, you can avoid the problem by disabling the cpu cgroup > from /etc/systemd/system.conf. That is, change > #DefaultControllers=cpu > into > DefaultControllers= > ---- > > Changing systemd.conf as suggested above solved the problem. Fine. -- Gilles.