Systemd booting and execute system command is Not successful!help!


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Systemd booting and execute system command is Not successful!help!
# 1  
Old 01-27-2016
Error Systemd booting and execute system command is Not successful!help!

hi guys,
booting centos7 and use systemd execute system command ulimit -SHn 202400 is fail.i dont know what's reason.can you give me help.


------------------------------------------
Code:
set-ulimit.service

[Unit]
Description=test service
After=systemd-update-utmp-runlevel.service  #the last booting systemd

[Service]
Type=oneshot
ExecStart=/root/test.script

[Install]
WantedBy=multi-user.target

-----------------------------------------------------------------------
/root/test.script

#!/bin/bash
ulimit -SHn 202400       #fail
date > /root/test.txt       #exec  success.


Last edited by Don Cragun; 01-27-2016 at 04:09 AM.. Reason: Add CODE and ICODE tags.
# 2  
Old 01-27-2016
I didn't work with systemd at all yet but...

Do check if the script is executable.

Also setting ulimit parameters is not te be done using startup service, but using /etc/sysctl.conf or /etc/sysctl.d/yourconf.conf for global setup or per user in
/etc/security/limits.conf.

Hope that helps
Regards
Peasant.
This User Gave Thanks to Peasant For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

I can not understand the command from the systemd?

journalctl --since "tomorrow" By idea to show magazines from tomorrow. As it is illogical. Tell me what is the essence of the team with the key tomorrow? Code tags please (1 Reply)
Discussion started by: alekseev
1 Replies

2. Linux

The Way Systemd Handles System Calls

Hi everyone, I have a question about the process management, and deep level system functionality of system calls between SystemD and SystemV? Does SystemD use the same system calls (fork(), exec(), bind() etc...) as SystemV? or Vice Versa? If they both use the same or very very similar sys... (2 Replies)
Discussion started by: Lost in Cyberia
2 Replies

3. Shell Programming and Scripting

Need to echo command successful if command is executed successfully

Hello, I have written a command n shell script : srvctl relocate service -d t1 -s s1 -i i1 -t t1 -f If the above command executes successfully without error I need to echo "Service relocated successfully and If it errors out I need to trap the errors in a file and also need to make... (1 Reply)
Discussion started by: Vishal_dba
1 Replies

4. Red Hat

Red Hat system not booting up

Hello, I had a linux server running mysql db without any issues, it just panic'd and now its not coming up , unfortunately we do not have backup for this server as well can anybody help on this. Following is the error Memory for crash kernel (0x0 to 0x0 ) notwithin permissible range Red... (2 Replies)
Discussion started by: fugitive
2 Replies

5. AIX

Successful user login, yet system claims invalid info

I have four AIX 6.1.7.4 systems freshly built and ready for our DBAs to do their work. Of the three one runs into an odd issue while logging in as himself, using Putty with ssh protocols. He logs in successfully, but also gets the following error message: : 3004-300 You entered an invalid login... (2 Replies)
Discussion started by: Mike Brendan
2 Replies

6. OS X (Apple)

How to execute a command when system boots?

Hi all, I want to execute a command when system boots. I tried to edit /etc/rc.common and add my command at the end of rc.common, but it does not work! Anyone knows how to do it? Thanks :) (6 Replies)
Discussion started by: andrewust
6 Replies

7. Shell Programming and Scripting

how to delete files at booting of system (system startup)

hi all I have a problem how to write a shell script which delete files/folder form directory whenever system boot and copy last updated folder/file in the specified directory.pse help me ASAP. i write a script which copy files in directory.I want when system boot up using script it check whether... (1 Reply)
Discussion started by: shubhig15
1 Replies

8. AIX

System is not booting

the error is 0518 /usr mnt failed, pleaze tell me how i can fix it ! (1 Reply)
Discussion started by: majd_ece
1 Replies

9. Shell Programming and Scripting

How to execute piped command using exec or system

Hi All, I want to execute a piped command like 'ls /opt | grep xml' using array as parameters list. How can I do that? (2 Replies)
Discussion started by: bharadiaam
2 Replies

10. AIX

Execute a command at the system restart

Hi Folks, I have an AIX server and I would like the server to run the command saprouter -r at every system restarts. It needs to be run by a specific user. How would I do that? Thanks!!! (1 Reply)
Discussion started by: brookingsd
1 Replies
Login or Register to Ask a Question