Jump to content

FreeBSD - Faster Boot, Cleaner, Shortcuts to ease your work | UPDATE 12.10.2021


Recommended Posts

1. Faster and cleaner boot:

Spoiler

1. Reduce boot time. Standard you have 10 seconds to wait. Enter /boot/loader.conf and type:

This is the hidden content, please

2. We will modify the following startup scripts

  • /etc/rc.d/ldconfig
  • /etc/rc.d/netif
  • /etc/rc.d/nfsclient
  • /etc/rc.d/random
  • /etc/rc.d/routing

Here is the summary of the changes. In most cases its just adding 1> /dev/null OR 1> /dev/null 2> /dev/null to not display unneeded information at boot process.

This is the hidden content, please

3. Next up is /etc/rc.d/random , search random_start() and comment the 5 lines shown below:

45:random_start()
46-{
47-
48-   # if [ ${harvest_mask} -gt 0 ]; then
49-   #       echo -n 'Setting up harvesting: '
50-   #       ${SYSCTL} kern.random.harvest.mask=${harvest_mask} > /dev/null
51-   #       ${SYSCTL_N} kern.random.harvest.mask_symbolic
52-   # fi
53-

4. Open /etc/rc.conf and at the end add:

rc_startmsgs=NO
defaultroute_delay="0"

5. In /etc open csh.login and csh.logout and at the end add: (this clears the console after login and logout)

clear

6. Open /etc/gettytab and search: P|Pc|Pc console:\  and modify like down below: (this clears the console after booting)

P|Pc|Pc console:\
    :ht:np:sp#9600:\  #the number is different for each machine. don't change this row!
    :cl=\E[H\E[2J:  #add just this line

 

2. Alias for shortcuts such as paths and executions.

Spoiler

Aliases are used like this: 

alias mycommand path
or
alias mycommand "path && execution"

The idea is to build shortcuts that will help us compile or open / close the server without typing addresses and file executions, giving them only a name. They can be used ANYWHERE in the system. Personal example:

alias server    "cd /usr/home/game/main && sh admin_panel.sh"
alias compileall    "cd /usr/src/Server/ && gmake all -j5"
alias compiledb    "cd /usr/src/Server/ && gmake db -j5"
alias compilegame    "cd /usr/src/Server/ && gmake game -j5"

these settings for me do the following:

  • server              #opens my admin panel for server start/stop/clear_logs/etc..
  • compileall        #compiles game&db
  • compiledb       #compiles db only
  • compilegame  #compiles game only

( That -j5 at the end is the use of 4 CPU cores at compilation execution. In your case it will be the number of cores used by your virtual machine and add +1 . Example: 8 cores? You will use -j9 )


Aliases are retained in memory, but after reboot they are deleted, so we have to set them permanently:
1.  We enter in the base folder of our machine user. For example, user root has /root folder.
in there you will find .cshrc or .shrc file (depends on FreeBSD version) and search for: alias ll
Under it add the alias you need, as shown above in the examples

UPDATED! 12.10.2021

3. Disable Send Mail - Credits to: @ martysama0134 (Not waiting after Send Mail Service on boot, it will reduce your boot time with 10 more seconds)

Spoiler

Open /etc/rc.conf and Edit/Add these options:

# NO SENDMAIL
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

Note: on old fbsd versions, it was used "NONE" instead of "NO" for sendmail_enable

Now, lets stop the sendmail service:

service sendmail stop

That's it! You can reboot and test it!

Hope it's usefull. It was for me 🙂 
Hope you have a great day!


Shahin

  • Metin2 Dev 83
  • Eyes 3
  • Dislove 1
  • Confused 2
  • Good 25
  • Love 6
  • Love 35
Link to comment
Share on other sites

6 hours ago, Denizeri24 said:

wtf is this, how many times do you have to reboot freebsd?

I just turn off sendmail, that's more than enough..

If you don't like it, just ignore it.

It's pretty good tutorial and this can save you some time.

Yes, you need to reboot freebsd when you work, but you will experience this once you will be more advanced.

  • Lmao 4

PeriodWars

release kraken GIF

Link to comment
Share on other sites

  • 6 months later...
  • 1 year later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.